Created
December 21, 2011 19:15
-
-
Save kaizimmer/1507272 to your computer and use it in GitHub Desktop.
Logs all errors passed to window.onerror handler
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.onerror = function ( descr, script, loc ) | |
{ | |
console.log("!!!!!!!!!!!"); | |
console.log("!!! ERROR: " + JSON.stringify( { description: descr, script: script, line: loc } )); | |
console.log("!!!!!!!!!!!"); | |
/*/ | |
return true; //stops error propagation | |
//*/ | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note:
Chrome: no custom errors supported (thrown by yourself) / line and file arguments not provided
Internet Explorer: Error objects other than "Error" (e.g. "TypeError") not supported
Opera: no support at all