3 Module ExceptionHandlingA
7 ' Finally block is executed regardless of how execution
8 ' leaves the Try statement
10 ' Case 1: through the end of Try block
19 Throw
New Exception("#EHA1 - Finally block not executed")
22 ' Case 2: through the end of Catch block
32 Throw
New Exception("#EHA2 - Finally block not executed")
35 ' Case 3: through an Exit Try statement
40 Console
.WriteLine(e
.Message
)
46 Throw
New Exception("#EHA3 - Finally block not executed")
49 ' Case 4: through a GoTo statement
54 Console
.WriteLine(e
.Message
)
60 Throw
New Exception("#EHA4 - Finally block not executed")
63 ' Case 5: by not handling a thrown exception
67 Throw
New Exception("EE")
76 Throw
New Exception("#EHA5 - Finally block not exceuted")