Adds unhandledrejection, that catches all unhandled promise rejection and logs them in callstats.

This commit is contained in:
damencho 2016-04-26 11:00:42 +03:00
parent 6a74296d3e
commit 1f98fbb99f
1 changed files with 10 additions and 0 deletions

View File

@ -320,6 +320,16 @@ export default {
if(oldOnErrorHandler)
oldOnErrorHandler(message, source, lineno, colno, error);
};
var oldOnUnhandledRejection = window.onunhandledrejection;
window.onunhandledrejection = function(event) {
JitsiMeetJS.getGlobalOnErrorHandler(
null, null, null, null, event.reason);
if(oldOnUnhandledRejection)
oldOnUnhandledRejection(event);
};
}
return JitsiMeetJS.init(config).then(() => {