Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
4
Task/Exceptions/Visual-Basic-.NET/exceptions-1.vb
Normal file
4
Task/Exceptions/Visual-Basic-.NET/exceptions-1.vb
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
Class MyException
|
||||
Inherits Exception
|
||||
'data with info about exception
|
||||
End Class
|
||||
3
Task/Exceptions/Visual-Basic-.NET/exceptions-2.vb
Normal file
3
Task/Exceptions/Visual-Basic-.NET/exceptions-2.vb
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
Sub foo()
|
||||
Throw New MyException
|
||||
End Sub
|
||||
13
Task/Exceptions/Visual-Basic-.NET/exceptions-3.vb
Normal file
13
Task/Exceptions/Visual-Basic-.NET/exceptions-3.vb
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
Sub bar()
|
||||
Try
|
||||
foo()
|
||||
Catch e As MyException When e.Data.Contains("Foo")
|
||||
' handle exceptions of type MyException when the exception contains specific data
|
||||
Catch e As MyException
|
||||
' handle exceptions of type MyException and derived exceptions
|
||||
Catch e As Exception
|
||||
' handle any type of exception not handled by above catches
|
||||
Finally
|
||||
'code here occurs whether or not there was an exception
|
||||
End Try
|
||||
End Sub
|
||||
Loading…
Add table
Add a link
Reference in a new issue