Arming an Exception Handler

When you have defined an exception handler, you must then arm it. The following syntax is used to arm an exception handler.

on exception-class do method-call-expression [global];

The exception-class identifier is the Exception class or one of its subclasses. Use the optional global system variable to arm a global exception handler. As a global exception handler is not associated with a specific method, it is always armed until it is explicitly disarmed. A local exception handler is automatically disarmed when the method that armed it returns.

Each process can have up to 128 global exception handlers armed at any one time. There is no JADE‑imposed restriction on the number of non-global exception handlers that can be armed at any time by any one process.

When you arm an exception handler, note the following points.