Need exception enumeration

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I've looked throughout the documentation for an exception enumeration, either by name or by number. I've come across several examples indicating there must be a list available. Somehow I'm missing it. Can some generous soul direct me to it? Thanks

polynomial5

Here are some examples

Public Class FileNotFoundException
Inherits Exception
' Implementation code goes here
End Clas

Try
' "Try" block
Catch e as ClassLoadException
' "Catch" block
Finally
' "Finally" block
End Tr

Tr
' "Try" block
Catch When ErrNum = 5 'Type mismatch
' "Catch" block
Finall
' "Finally" block
End Tr

' Derive an exception with a specifiable message and inner exception
Class LogTableOverflowExceptio
Inherits Exceptio
 
On the above URL click for exemple on System.Exception and then Derived
classes to see all exceptions derived from System.Exception. (includes
System.Data.DBConcurrencyException).

Exception are catch based on their type and you can have multiple Catch
blocks. Make sure to go from the more specific to the more general
exceptions (the activated block is the first one that fits).
See :
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbls7/html/vblrfvbspec8_11_1_2.asp
for the Catch block.




Thank you Patrice.

I spent two hours with the documentation. I then printed some out, as
well as some material from ADO.NET Core Reference, went to a cafe and tried
to figure it out. Not successful.
Here's a code snippet from ADO.NET Core Reference

Private Sub HandleRowUpdated(ByVal sender As Object, _
ByVal e As OleDbRowUpdatedEventArgs)
If e.Status = UpdateStatus.ErrorsOccurred AndAlso _
TypeOf(e.Errors) Is DBConcurrencyException Then
ConflictAdapter.SelectCommand.Parameters(0).Value = e.Row("ID")
Dim intRowsReturned As Integer
intRowsReturned = ConflictAdapter.Fill(ConflictDataSet)
If intRowsReturned = 1 Then
e.Row.RowError = "The row has been modified by another user."
Else
e.Row.RowError = "The row no longer exists in the database."
End If
e.Status = UpdateStatus.Continue
End If
End Sub

Note the DBConcurrencyException

It's the list of these I'm looking for. Particularly DB errors.

It seems the author is doing things in a terribly complicated manner. I
simply want to identify the type of error in a try..catch..finally..endtry
structure. And then handle a couple particular types in one manner, and
everything else in another manner.
So, what I need is the following. The list of names of the exceptions,
and the syntax of catching one in a catch clause. So far I just can't
figure it out.
 
Back
Top