A
Alex
Hi,
is it possible to determine exactly what type of error/exception was thrown
from a try catch block bt simple catching the generic error.
by this I mean, suppose I have the follwoing code
try
'do some database stuff
catch err as exception
'err now contains my error
end try
The most light error that accessing a db would throw is of type
System.Data.OleDb.OleDbException.
Do I need to specifically look for this type of excepotion in a catch block
try
catch err as System.Data.OleDb.OleDbException
catch err as exception
end try
or can I specifically tell from catching a generic error that it is of type
System.Data.OleDb.OleDbException.
I've noticed that certain methods can throw many types of exception so is to
best to have a catch handler for each type, or just have a generic catch
hanler and then from the object that is caught determine the type of
exception that was thrown.
cheers
alex.
is it possible to determine exactly what type of error/exception was thrown
from a try catch block bt simple catching the generic error.
by this I mean, suppose I have the follwoing code
try
'do some database stuff
catch err as exception
'err now contains my error
end try
The most light error that accessing a db would throw is of type
System.Data.OleDb.OleDbException.
Do I need to specifically look for this type of excepotion in a catch block
try
catch err as System.Data.OleDb.OleDbException
catch err as exception
end try
or can I specifically tell from catching a generic error that it is of type
System.Data.OleDb.OleDbException.
I've noticed that certain methods can throw many types of exception so is to
best to have a catch handler for each type, or just have a generic catch
hanler and then from the object that is caught determine the type of
exception that was thrown.
cheers
alex.