GOTOs with TRY statements

Certain uses of GOTO statements when using TRY style error handling can cause unexpected behavior if care is not taken. If a GOTO statement is used to jump into the body of a TRY statement from outside of the TRY statement, the ONERROR block will not be invoked if an error occurs. Execution must flow naturally into a TRY statement for error handling to be properly initialized by EASI. Similarly, if a GOTO statement is used to jump outside of a TRY block from with the TRY block, a subsequent error in the same procedure or function will still cause the ONERROR block to be invoked. Execution must flow naturally out of a TRY block for the error handling to be properly disabled by EASI.

In general, GOTO statements should not be used to enter or exit TRY statements.

© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.