Skip to content

Instantly share code, notes, and snippets.

@nathggns
Created September 27, 2013 11:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nathggns/6727083 to your computer and use it in GitHub Desktop.
Save nathggns/6727083 to your computer and use it in GitHub Desktop.
Wrap Errorception to provide stack traces in some browsers
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