Does try ... catch(e) provide the same service as On Error Resume Next in VB?
I have a page which uses several JQuery plugins as well as some functions I have written myself. It would take a lot of work to address all possible exceptions.
For now, I want to tell the script not to break on would be fatal errors. How do I do that when I’m using plugins?
Yes,
try/catchprovides a way to capture errors, though unlike On Error Resume Next you choose to deal with the error in thecatchblock or not at all.So in VB you might have done:
In JS you’d do the following:
Of course empty catch blocks are evil so don’t leave them in production code yadda yadda. The best thing is to let the errors occur and fix them. Fail fast!