is catchable

operator

Return type:
Switch
Returns:
true if catch-name is active at this point in the program, and false otherwise. Replacing is with isnt will reverse the results.
Syntax
catch-name (is | isnt) catchable


Purpose

Tests whether catch-name is active at this point in the program. A catch is active only when it is in a scope that is currently executing.

catch-name can be any of the following:

A compile-time error results if catch-name is not declared within the program, nor is it one of the two built-in catches.

The following code uses is catchable to see if there is a currently active catch named empty-recordset before throwing to it:

  do when empty-recordset is catchable
     throw empty-recordset
  
  else
     log-message "Received an empty record-set."
     halt with 1
  done