"Boni" <oilia@nospam> wrote in message
news:Oa**************@TK2MSFTNGP14.phx.gbl...
is it possible to handle 2 exception tipes in one block?
Yes; catch a more "generic" Exception Type, then interrogate the
Exception you've caught to find out what it actually is.
.. . .
Catch ex as Exception
If TypeOf ex Is ArgumentException Then
. . .
End If
Note that you /can/ go down the road of defining your own,
custom Exceptions and inherit one from the other, something like :
Class myBasicException
Inherits ApplicationException
. . .
End Class
Class myNumberedException
Inherits myBasicException
. . .
Public Number as Integer
. . .
End Class
Class myOtherException
Inherits myBasicException
. . .
End Class
then
.. . .
Catch ex as myBasicException
If Typeof ex Is myNumberedException Then
ElseIf Typeof ex Is myOtherException Then
Else
Throw
End If
Catch ex as ApplicationException
. . .
Catch ex as Exception
. . .
HTH,
Phill W.