Reference > Rule Languages > ILOG Rule Language > IRL Keywords > catch

Summary

The keyword within a try statement for designating exceptions that will be caught if thrown. This keyword is used in a function or rule action.

Syntax

try {statements} 
catch (exceptionType1 identifier) {statements} 
[catch (exceptionType2 identifier) {statements} 
...]
finally {statements}

Description

The try-catch-finally statements establish a block of code for exception handling. The blocks all begin and end with curly braces.

The catch statements are designed to handle a specific type of exception. The code within a catch statement is executed if an exception is caught. A catch statement is declared with an exceptionType that specifies the type of exception the statement can handle and also provides an identifier the statement can use to refer to the exception object it is currently handling. The identifier must be of type Throwable or one of its subclasses.

See Also

try