TRY Statements and ON Statements

If a TRY statement and an ON statement are both in effect, and a fault occurs, the system examines the more recent of the two statements. The system invokes the ON statement if ON is the more recent statement and it is coded to handle the fault in question. Otherwise, the system invokes the TRY statement.

For example, ON Statements and TRY Statements shows two process stacks that each includes an ON statement and a TRY statement.

Figure 3. ON Statements and TRY Statements

ON Statements and TRY Statements


In this example, if a termination condition occurs for process stack 1, the TRY statement is used instead of the ON statement, because the TRY statement is more recent. If a termination condition occurs for process stack 2, then the system checks the ON statement first, because the ON statement is more recent than the TRY statement. However, if the condition cannot be handled by the ON statement, the system executes the TRY statement instead.