No Errors, Please

No comments yet

It’s common practice these days to disable server-side errors on a production site, so much so that most major frameworks (Rails, CodeIgniter & more) all have switches for what is essentially live & dev.

One of my major issues with Internet Explorer, is making a meal out of JavaScript errors. Even if something works properly, it’ll still throw in some errors. I would prefer to hide those on the production site, wouldn’t you?

Prepare for a hack!

window.onerror = function(){
    return true;
}

Wonderful stuff right? What it’s doing is; when an error is reported, return true, which is just skipping any reporting of it. So, no errors being reported to the browser, no annoying alerts for your users.

Problem; solved.

Leave a Reply