Skip to content

Instantly share code, notes, and snippets.

@zela
Created March 18, 2011 12:26
Show Gist options
  • Save zela/875973 to your computer and use it in GitHub Desktop.
Save zela/875973 to your computer and use it in GitHub Desktop.
limited error handling
// from Flanagan book
window.onerror = function (msg, url, line) {
if (onerror.num++ < onerror.max) {
alert("Error: " + msg + "\n" + url + ":" line);
return true;
}
}
onerror.max = 3;
onerror.num = 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment