Understanding exceptions

Exceptions are abnormal runtime events that can be trapped for control.

If an instruction executes abnormally, the runtime system throws exceptions that can be handled by the program.

Specific exception actions can be taken based on the class of the exception.

Runtime errors (exceptions) can be trapped by a WHENEVER exception handler or by a TRY/CATCH block. The WHENEVER exception is provided for compatibility with Informix 4GL, consider using TRY/CATCH blocks instead.

Note: Some specific errors such as error -1338 cannot be trapped. In such case, the program will always stop and show the error, even if a WHENEVER exception handler or TRY/CATCH block is used.

A Genero exception is identified by its number and has a description. For a complete list of BDL errors, see Genero BDL errors.

Exception handlers are typically used to detect database errors when executing SQL statement. For more details, see SQL execution diagnostics