Created
September 27, 2013 11:10
-
-
Save nathggns/6727083 to your computer and use it in GitHub Desktop.
Wrap Errorception to provide stack traces in some browsers
This file contains 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(old) { | |
return function() { | |
var args = [].slice.call(arguments); | |
for (var i = 0, l = arguments.length; i < l; i++) { | |
if (args[i] instanceof Error) { | |
window._errs.push(args[i]); | |
} | |
} | |
return old.apply(this, arguments); | |
} | |
})(window.onerror); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment