Sometimes, users may want to forcibly stop a scenario from execution after the rollback or commit phase has occurred, or they wish to stop processing a route and store the route in the incomplete executions queue instead.
Currently, the error handling directives cannot be used anywhere else other than in an error handling route. To "throw" an error is therefore a workaround where users can then use these error handling directives conditionally.
The JSON Method
To conditionally throw an error, users can configure a module to make it purposely fail during its operation. One method is to run JSON > PARSE JSON, a module configured to optionally throw an error (BundleValidationError in this case).
Users are to then attach one of the following error handling directives to the error handling route:
- Rollback: forces the scenario execution to stop and perform the rollback phase
- Commit: forces the scenario execution to stop and perform the commit phase
- Ignore: stops the processing of a route
- Break: stops the processing of a route and storing it in the incomplete executions queue
The HTTP Method
Users may also try the following workaround:
- Usecase: users are to retry after some time if no record was found using Break Directive. Usecase is crucial when your record does not instantly instantly update instantly, or you would like to automate the process later in your route. This break directive is less complex to set up.
The following are some scenarios on using the HTTP module.
- Replace the Module where you want to throw an error with: HTTP > Make a Request module
- Configure the URL within the query parameter, and add an optional query parameter to search for the email
- Enable the advanced settings. Check and evaluate all displayed states as errors.
- Add a Break handler in that HTTP module and configure the setup to run later.
We will continue to update this space with more throw scenarios for better error handling and management.