CATCH
Syntax
<catch-expression> := 'CATCH(' <Any>, <Any> ')'
Since
2.5
Return-type
The common supertype of both arguments
Description
The CATCH function catches and supresses any error thrown while the evaluation of the first arguments and returns the result of the second argument instead. If no error occurs, the result of the first argument is returned.
The return type of this function is the common supertype of both arguments. E.g. if the first argument has the type "Double" and the second has "String", the return type would be "Value".
Examples
CATCH( Amount(), 'Not available' )
Evaluates "Amount()" and returns (if no error was thrown) the result of this expression. If any error occurs (e.g. if the fact Amount is not available offline and no database is connected), the string 'Not available' is returned.
See also
SWITCH
