The TRY Statement
The TRY...CATCH...FINALLY...END-TRY structure is the basis for structured
exception handling. The TRY block allows you to test a section of code for
exceptions that may occur during its execution. The CATCH block must specify
the type of exception you wish to handle if one should occur during the execution
of the TRY block. The FINALLY block allows you to execute a section of code
following the TRY block, whether or not an exception occurred.
General Formats

Syntax Rules
- Identifier-1 must be an object reference of class System.Exception or a subclass
of System.Exception.
General Rules
- Execution of the TRY statement begins with imperative-statement-1.
- If an exception is raised during the execution of imperative-statement-1,
each CATCH phrase is examined in the order specified until one is found for
which identifier-1 is either a descendant of or equal to the class of the
exception that was thrown. If such an identifier-1 is found, the associated
imperative-statement-2 is executed. Execution continues according to the rules
for each statement specified in imperative-statement-2. If a control branching
or conditional statement that causes explicit transfer of control is executed,
control is transferred in accordance with the rules for that statement; otherwise,
upon completion of the execution of imperative-statement-2, control is transferred
to imperative-statement 3, if specified, or to the end of the TRY statement.
- If no exception is raised during the execution of imperative-statement-1,
execution continues according to the rules for each statement specified in
imperative-statement-1. If a control branching or conditional statement that
causes explicit transfer of control is executed, control is transferred in
accordance with the rules for that statement; otherwise, upon completion of
the execution of imperative-statement-1, control is transferred to imperative-statement
3, if specified, or to the end of the TRY statement.
- Execution of imperative-statement-3 continues according to the rules for
each statement specified in imperative-statement-3. If a control branching
or conditional statement that causes explicit transfer of control is executed,
control is transferred in accordance with the rules for that statement; otherwise,
upon completion of the execution of imperative-statement-3, control is transferred
to the end of the TRY statement