Merge pull request #587 from damencho/global-error-handler

Enables global error handler.
This commit is contained in:
hristoterezov 2016-04-06 13:11:22 -05:00
commit 8842823607
1 changed files with 13 additions and 0 deletions

View File

@ -316,6 +316,19 @@ export default {
this.roomName = options.roomName;
JitsiMeetJS.setLogLevel(JitsiMeetJS.logLevels.TRACE);
// attaches global error handler, if there is already one, respect it
if(JitsiMeetJS.getGlobalOnErrorHandler){
var oldOnErrorHandler = window.onerror;
window.onerror = function (message, source, lineno, colno, error) {
JitsiMeetJS.getGlobalOnErrorHandler(
message, source, lineno, colno, error);
if(oldOnErrorHandler)
oldOnErrorHandler(message, source, lineno, colno, error);
};
}
return JitsiMeetJS.init(config).then(() => {
return Promise.all([
// try to retrieve audio and video