You guys are talking about things that should be discovered during development, in which case, I'd rather have the exception thrown and showing in the console than to try to write a function to handle them.
Also, I guarantee you will always get exceptions in production that you didn't see in development. Browsers are different, users do things you didn't think to test. If you care about quality, you need a system in place for reporting those exceptions back to the mothership, again including meaningful traces.