Add unhandledrejection handling

main
Isaiah Odhner 2022-02-24 20:43:46 -05:00
parent 2141a67664
commit e054b561c0
2 changed files with 8 additions and 0 deletions

View File

@ -17,3 +17,7 @@ window.onerror = function (msg, url, lineNo, columnNo, error) {
}
return false;
};
window.onunhandledrejection = function (event) {
alert('Unhandled Rejection: ' + event.reason);
}

View File

@ -14,6 +14,10 @@ window.onerror = function (message, source, lineno, colno, error) {
}
};
window.onunhandledrejection = function (event) {
show_error_message(localize("Internal application error.") + "\nUnhandled Rejection.", event.reason);
};
if (/MSIE \d|Trident.*rv:/.test(navigator.userAgent)) {
document.write(
'<style>body { text-align: center; }</style>' +