This appendix provides information on error handling.
A Try block tries to execute some code and reacts to errors. The syntax is as follows:
Try try_statements... [Catch ex As exception_type_1 exception_statements_1...] [Catch ex As exception_type_2 exception_statements_2...] ... [Catch final_exception_statements...] [Finally finally_statements...] End Try
When an error occurs, the program examines the Catch statements until it finds one that matches the current exception. The program executes the finally_statements after the try_statements succeed or after any Catch block is done executing.