Top  Previous  Next


The CAUGHT() function allows an application to test whether there is a handler established for a named exception.





CAUGHT(exception, modes)




exceptionevaluates to an exception name.


modesidentifies which special exception handlers are to be included.



An exception is a named event, typically an error, raised within an application by use of the THROW statement. The CAUGHT() function returns True or False to indicate whether there is an active exception handler for a given exception name. Exception names are case insensitive and may be up to 32 characters.


The modes argument determines whether special exception handlers are included in the scan. This is an additive bit significant value formed from

1Include the SYS$ANY handler
2Include the SYS$UNHANDLED handler


A mode value of zero tests strictly for the named handler.



See also:

Exception handling, THROW, TRY/CATCH