From 1f98fbb99fcc64c756fa265fdf9d789dd541179a Mon Sep 17 00:00:00 2001 From: damencho Date: Tue, 26 Apr 2016 11:00:42 +0300 Subject: [PATCH] Adds unhandledrejection, that catches all unhandled promise rejection and logs them in callstats. --- conference.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/conference.js b/conference.js index ac89e1f5e..2bbd5b8a0 100644 --- a/conference.js +++ b/conference.js @@ -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(() => {