|
@@ -7,7 +7,6 @@ import { PARTICIPANT_LEFT } from '../participants/actionTypes';
|
7
|
7
|
import MiddlewareRegistry from '../redux/MiddlewareRegistry';
|
8
|
8
|
|
9
|
9
|
import JitsiMeetJS from './_';
|
10
|
|
-import { LIB_WILL_INIT } from './actionTypes';
|
11
|
10
|
import { disposeLib, initLib } from './actions';
|
12
|
11
|
|
13
|
12
|
/**
|
|
@@ -22,14 +21,6 @@ import { disposeLib, initLib } from './actions';
|
22
|
21
|
*/
|
23
|
22
|
MiddlewareRegistry.register(store => next => action => {
|
24
|
23
|
switch (action.type) {
|
25
|
|
- case LIB_WILL_INIT:
|
26
|
|
- // Moved from conference.js init method. It appears the error handlers
|
27
|
|
- // are not used for mobile.
|
28
|
|
- if (typeof APP !== 'undefined') {
|
29
|
|
- _setErrorHandlers();
|
30
|
|
- }
|
31
|
|
- break;
|
32
|
|
-
|
33
|
24
|
case SET_NETWORK_INFO:
|
34
|
25
|
JitsiMeetJS.setNetworkInfo({
|
35
|
26
|
isOnline: action.isOnline
|
|
@@ -81,47 +72,3 @@ function _setConfig({ dispatch, getState }: IStore, next: Function, action: AnyA
|
81
|
72
|
|
82
|
73
|
return result;
|
83
|
74
|
}
|
84
|
|
-
|
85
|
|
-/**
|
86
|
|
- * Attaches our custom error handlers to the window object.
|
87
|
|
- *
|
88
|
|
- * @returns {void}
|
89
|
|
- */
|
90
|
|
-function _setErrorHandlers() {
|
91
|
|
- // attaches global error handler, if there is already one, respect it
|
92
|
|
- if (JitsiMeetJS.getGlobalOnErrorHandler) {
|
93
|
|
- const oldOnErrorHandler = window.onerror;
|
94
|
|
-
|
95
|
|
- // TODO: Don't remove this ignore. The build fails on macOS and we don't know yet why.
|
96
|
|
-
|
97
|
|
- // @ts-ignore
|
98
|
|
- window.onerror = (message, source, lineno, colno, error) => { // eslint-disable-line max-params
|
99
|
|
- const errMsg = message || error?.message;
|
100
|
|
- const stack = error?.stack;
|
101
|
|
-
|
102
|
|
- JitsiMeetJS.getGlobalOnErrorHandler(errMsg, source, lineno, colno, stack);
|
103
|
|
-
|
104
|
|
- if (oldOnErrorHandler) {
|
105
|
|
- oldOnErrorHandler(message, source, lineno, colno, error);
|
106
|
|
- }
|
107
|
|
- };
|
108
|
|
-
|
109
|
|
- const oldOnUnhandledRejection = window.onunhandledrejection;
|
110
|
|
-
|
111
|
|
- window.onunhandledrejection = function(event) {
|
112
|
|
- let message = event.reason;
|
113
|
|
- let stack: string | undefined = 'n/a';
|
114
|
|
-
|
115
|
|
- if (event.reason instanceof Error) {
|
116
|
|
- ({ message, stack } = event.reason);
|
117
|
|
- }
|
118
|
|
-
|
119
|
|
- JitsiMeetJS.getGlobalOnErrorHandler(message, null, null, null, stack);
|
120
|
|
-
|
121
|
|
- if (oldOnUnhandledRejection) {
|
122
|
|
- // @ts-ignore
|
123
|
|
- oldOnUnhandledRejection(event);
|
124
|
|
- }
|
125
|
|
- };
|
126
|
|
- }
|
127
|
|
-}
|