Re:JavaScript Tips
by DougWebb on Thursday May 06, 2010 @07:37AM
(#1324145)
I just use:
Of course I do all of my debugging in Firefox with Firebug, and my goal is to ensure that these errors don't happen in production code so other browsers never hit the try/catch block. In rare cases where an error only happens in IE, I can throw an alert into the catch.
[ Parent
| on HN ]
Re:JavaScript Tips
by CoryMathews on Thursday May 06, 2010 @12:49PM
(#1324834)
Its terrible practice to catch an error and do nothing with it.
Generally yes, I agree. But in this case all I'm doing with the error is displaying it to the programmer, and it doesn't matter to me if the programmer has to be using Firefox to see it. We were talking about displaying debugging messages and dealing with a missing console, not handling application failures.