For the JavaScript code like this:
try {
MyJob.process();
} catch(e) {
console.log("Exception occur!");
}
I run the code in Chrome or FireFox, When the exception happens, the line number of “Exception occur!” will be shown in console, but the original exception in MyJob won’t be there. Is there any solution that show the original position where the exception happens and keep the try-catch that I write here?
This will show most of the errors.
In the catch block add:
More about the error handling at JavaScriptkit
If the try/catch block is inside a function you could take advantage of the
arguments.calleemdn msdnResult will be: