Data privacy notice

 

When this content is loaded, usage information is transmitted to Vimeo and may be processed there.

 

             

Workflow flow control: Handle errors

Modified on Tue, 2 Apr at 10:06 AM

The error handling block is a flow control element that lets you catch errors and handle them appropriately, to prevent the workflow from failing.


In structured programming, this flow control elements corresponds to a TRY-CATCH-Statement.


An error handling block. On the left-hand side (1) are actions that might result in an error. In case an error occurs, the action on the right-hand side (2) are executed. In this example, the state is changed to Email error when the email could not be sent.


Introduction

All standard actions provided by formcycle might result in an error. When a processing chains ends with an unhandled error, the entire workflow is aborted and no more processing chains for the same event are executed. The form record is marked as having failed. See also the help page regarding error handling.


To prevent this, you can catch error with an error handling block. In case an error occurred, you can add custom actions that should be executed in that case.


An alternative or complementary approach to handling error is the workflow event workflow error.


Error handling block

Beispiel eines Fehlerbehandlungsblocks mit mehreren Bedingungen, durch welche je nach Fehlertyp unterschiedliche Stellen per E-Mail informiert werden.

You can catch errors with the error handling block. If an error is caught, the processing chain as a whole is considered as having completed normally, i.e. treated as successful. 


The error handling block is made up of the following parts:

  • On the left hand side are the actions that may result in an error. Once any action fails with an error, the remaining actions are aborted.
  • On the right hand side are the actions which are executed if an error occurs.


After all actions inside the error handling block were executed (whether or not an error occurred), workflow processing continues with the actions after the error handling block, i.e. the actions below the block.


You can use conditions on the right-hand side of the error handling block to check the type of error and react accordingly. This lets you treat different errors wit a single error handling block.


In case an error on the right-hand side of the error handling block also results in an (unhandled) error, the entire error handling block is considered unsuccesful, and the workflow is aborted. Note that you can nest error handling block if you wish to handle such errors within an error handling block.


Variables

You can access details about the error with the following variables, which are available both on the right-hand side of the error handling block as well as within the workflow event workflow error.

  • [%$LAST_ERROR%] The additional data provided for the error, which depends on the type of action and on the type of error. 
  • [%$LAST_ERROR_CODE%] The technical name of the error.
  • [%$LAST_ERROR_MESSAGE%] A description of the error.
  • [%$LAST_ERROR_NODE_NAME%] The name of the action which failed.
  • [%$LAST_ERROR_NODE_TYPE%] The technical type of the action which failed, e.g. FC_EMAIL

The contents of these variables depend on the action which failed, see the documenation for the various workflow actions.  

By using such variables, you can, for example, check the type of error and react differently depending on the errror type.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article