Procházet zdrojové kódy

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

dev1
damencho před 9 roky
rodič
revize
7a64a59f14
1 změnil soubory, kde provedl 11 přidání a 0 odebrání
  1. 11
    0
      JitsiMeetJS.js

+ 11
- 0
JitsiMeetJS.js Zobrazit soubor

@@ -66,6 +66,17 @@ var LibJitsiMeet = {
66 66
                 if (oldOnErrorHandler)
67 67
                     oldOnErrorHandler(message, source, lineno, colno, error);
68 68
             }
69
+
70
+            // if an old handler exists also fire its events
71
+            var oldOnUnhandledRejection = window.onunhandledrejection;
72
+            window.onunhandledrejection = function(event) {
73
+
74
+                JitsiMeetJS.getGlobalOnErrorHandler(
75
+                    null, null, null, null, event.reason);
76
+
77
+                if(oldOnUnhandledRejection)
78
+                    oldOnUnhandledRejection(event);
79
+            };
69 80
         }
70 81
 
71 82
         return RTC.init(options || {});

Načítá se…
Zrušit
Uložit