Created
May 5, 2015 07:59
-
-
Save vladimir-kotikov/ef49a1b8b7525993a8ab to your computer and use it in GitHub Desktop.
window.onerror
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(message, url, line, col, error) { | |
var errMessage = message + | |
'\nat: ' + url + ':' + line + ':' + col + | |
!!error ? JSON.stringify(error, null, 4) : ''; | |
if (window.alert) { | |
alert(errMessage); | |
} else { | |
console.log(errMessage); | |
} | |
return true; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment