Try/Catch actor
Event action – Abstract
Purpose: Enables the interception and 'handling' of errors when executing event actions within an event handler.
The Try/Catch actor enables controlled responses to errors in the context of event handlers.
Error handling can be especially helpful when Loster_data profiles are called (see Call profile (Event action)).
The configuration of the action separates the process into two 'branches':
The Try branch contains actions for which the error handling should apply.
The Catch branch contains actions to execute when an error occurs in the Try branch.
►NOTE◄ If the Catch branch contains no actions, event handling will continue below the Try/Catch actor in case of an error without any notice.
In the event of an error, an object of the 'Error information' type is available in the Catch branch, from whose properties further details about the error can be taken via an Object property value resolver.
Try/Catch actors can be nested to handle errors by levels. The Abort can be used to pass control from a nested Catch branch to the Catch at the parent level.
In general, an Abort can be used to raise errors with specific properties.
►NOTE◄ The Try/Catch actor does not catch all types of errors. In particular, database errors that would compromise the integrity of the transaction cannot be caught.
Configuration examples:
A Search (Event action) (not shown in the screenshot) provides tuple search results with aggregated information on certain shipments as a list in variable shipments.
This list is processed in a For each loop, (on the left in the image), to issue notifications with the average value per package.
If an error occurs within the loop in the Try branch, the Catch branch is processed and an error message is output. This terminates the loop.
Since the calculation in the loop involves a division by the number of packages, the loop is aborted with an error – if there is a shipment with a value of 0 for the number of packages:
If the loop should continue with the next shipment after showing an error message instead of being terminated, the 'Try/Catch' actor must be used inside the loop:
The following output illustrates that the loop is not terminated after the first error: