Javascript: Exception Details
Exceptions do occur in any programming language, and knowing the type and details of the exception can be very crucial in debugging and determining a solution to the cause. I recently ran into a problem with one of my javascript functions and could not figure out why it was occurring. Little did I know that Javascript also provides exception information in the try, catch block. Here goes:
try {
myObject.myFunction(arg)
}
catch (e) {
if (e.description.indexOf('access') !=-1) myObject.otherFunction(arg)
else alert(e.description)
}
Last Updated:Thursday, September 02, 2010By:alfero#
with your OpenID.
If you do not know what OpenID is,