At the moment if an error is produced within a Promise then this won't be caught, as by default these aren't bubbled up to the onerror. onunhandledrejection should be also listened to such that these issues can be reported. e.g.
(function () {
// Create onerror handler to log uncaught exceptions to the server side log, but only if there
// is no such handler already.
// Must use "typeof window" here, because in NodeJs, window is not defined at all, so cannot refer to window in any way.
if (typeof window !== 'undefined' && !window.onunhandledrejection) {
window.onunhandledrejection = function (event) {
// Send object with all data to server side log, using severity fatal,
// from logger "onerrorLogger"
JL("onerrorLogger").fatalException({
"msg": "unhandledrejection",
"errorMsg": event.reason.message
}, event.reason);
// Tell browser to run its own error handler as well
return false;
};
}
})();
At the moment if an error is produced within a Promise then this won't be caught, as by default these aren't bubbled up to the
onerror
.onunhandledrejection
should be also listened to such that these issues can be reported. e.g.