Skip to content

Instantly share code, notes, and snippets.

@ajaxray
Created May 15, 2012 10:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ajaxray/2700829 to your computer and use it in GitHub Desktop.
Save ajaxray/2700829 to your computer and use it in GitHub Desktop.
Suppressing/Disable/Hide JavaScript Errors and logging them
window.onerror = function myErrorFunction(message, url, linenumber) {
if(console != undefined){
console.log('Error: '+ message + ' Of: ' + url + ' At: line: ' + linenumber)
}
// I want to keep silent
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment