attempt, recover

Syntax

[#attempt]
    attempt body
[#recover]
    recover body
[#/attempt]

where:

Description

The attempt and recover directives are used together in order to handle cases where errors may occur, and provide alternate processing for this case.

If an error occurs in the attempt block, the recover block is executed. If an error does not occur, the recover block will not be executed.

Examples

[#attempt]
    My name is ${class.myScript}.
[#recover]
    Oops! the script failed.
[/#attempt]