Skip to content

Commit

Permalink
Install a window error handler so we can log errors
Browse files Browse the repository at this point in the history
  • Loading branch information
gashcrumb committed Oct 22, 2013
1 parent f4ed40e commit 3902b47
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion hawtio-web/src/main/webapp/index.html
Expand Up @@ -303,7 +303,7 @@ <h2 title="Status Code: {{connectFailure.status}}">Cannot Connect: {{connectFail
if (isArrayOrObject(message)) {
text = text + JSON.stringify(message);
} else {
text = text + " " + message;
text = text + message;
}
}

Expand All @@ -327,6 +327,13 @@ <h2 title="Status Code: {{connectFailure.status}}">Cannot Connect: {{connectFail

});

// Catch uncaught exceptions and stuff so we can log them
window.onerror = function(msg, url, line) {
Logger.error(msg, " (url:", url, ", line:", line, ")");
// supress error alert
return true;
}

// sneaky hack to redirect console.log !
window.console = {
log: Logger.debug,
Expand Down

0 comments on commit 3902b47

Please sign in to comment.