Use the EXCEPTION statement to check for a specified exception condition and identify the script that is to handle the exception when it occurs. The exception condition is described by an exception definition script and is handled by an exception handler script. An EXCEPTION statement is active for the duration of a script, continuously checking for the specified exception condition in the background while the main script is running.
Exception definitions and handlers are similar to normal scripts; however, they do not accept input parameters, and they do not return anything except the script return code.
The following are examples of exception conditions:
Blueworx Voice Response provides the following built-in exception definition scripts.
When any of these conditions occur, the script is aborted. If you want to handle a specific condition differently, you need to write an exception handler for that condition.
The EXCEPTION statement is necessary only when you specify your own exception definition or exception handler. If you do not include an EXCEPTION statement in a script, Blueworx Voice Response handles exceptions in the “default” manner; that is, if a condition specified by one of the built-in exception definition scripts is encountered, the script is aborted.
EXCEPTION statements must appear after the INPUT and OUTPUT statements.
If either of the exception definition or exception handler script names specified in the EXCEPTION statement is not found, the EX_NO_SCRIPT exception definition script is invoked. By default, the script is abnormally terminated. To handle a failed EXCEPTION statement in a different way, you need to write an exception handler for this condition.
EXCEPTION My_exception_definition, My_exception_handler;
EXCEPTION EX_NO_SCRIPT, No_script_handler;
To use the 3270 Script window’s Statements menu to define an EXCEPTION statement, follow this procedure:
The system displays the Exception Statement Definition window.
In the Exception Definition Script window:
In the Exception Handler Script window:
The EXCEPTION statement is added to the script.