Log global errors

Use the global error handler, window.onerror, to catch miscellaneous
exceptions and pipe them into the debug log.

Fixes #456

// FREEBIE
pull/749/head
lilia 10 years ago
parent c1aada4f0f
commit ae3a834b4c

@ -33,5 +33,9 @@
}).fail(resolve);
});
};
window.onerror = function(message, script, line, col, error) {
console.log(error);
};
}
})();

@ -5,11 +5,22 @@
(function () {
'use strict';
function logError(error) {
extension.windows.getBackground(function(bg) {
bg.console.log('index.html: ', error);
});
}
window.onerror = function(message, script, line, col, error) {
logError(error);
};
var view;
function render() {
extension.windows.getBackground(function(bg) {
extension.windows.getCurrent(function(appWindow) {
try {
if (view) { view.remove(); }
var $body = bg.$('body',document).empty();
view = new bg.Whisper.InboxView({appWindow: appWindow});
@ -20,6 +31,10 @@
}
};
openConversation(bg.getOpenConversation());
} catch (e) {
logError(e);
}
});
});
}

Loading…
Cancel
Save