But what is "e"?What is tricky with JavaScript exception handling is that you aren't told what type of object e is.In my case I know, because there is only one statement to go wrong in the try block. It's going to be an ADO Error object. To execute different code depending on the object type, you can use instanceof as shown below, or do like I did and just dump the exception to see what it was: catch ( e )
{
// find out what exception was thrown
if ( e instanceof Error )
{
// it's a Error object, so you
// can treat it like one
}
else
{
// no idea, so let's dump the properties
for ( var p in exception )
Out ( p + '=' + exception [ p ] + '<br>' );
}
}
|
Part 4: Displaying the exception... |