Throw Error
Note: The Actions Quick Reference provides a complete list of actions that you can print for easy reference.
The Throw Error action simulates a system error, allowing you to resolve different error scenarios.
For example, a data record has the wrong person's name in it, but this does not cause an error. You can use the Throw Error action to either run the Error Task or throw an error message and stop the script and resolve the data record issue.
Create a Throw Error action
-
On the Actions list, click Flow and select Throw Error in the Errors section.
-
Enter the custom action Details. Optionally, click the Magic Wand to use the Expression Builder. For example, you can enter a custom string and a token from the Expression Builder that contains the name of the current task.
-
(Optional) Add a Note to document special instructions or functionality.
-
Toggle the run switch to Run and click OK to execute and save the action.
Note: The run switch is set to Run by default. To create or modify this action without executing it, click the slider to change the option to Don't Run. For more information, go to Action Builder.
If you execute the action without an Error Task, you will receive a warning message from the action and the script will stop. If you execute the action with an Error Task, the Error Task will run and the following list of tokens in the Botflow category will reflect the simulated error (Throw Error action).
-
Last Error Action Details: The action details of the action that caused the error (from step 2 above).
-
Last Error Action Line Number: The line number of the action that caused the error.
-
Last Error Action Name: The name of the action that caused the error.
-
Last Error Action Notes: The notes that were added to the action that caused the error.
-
Last Error Message: The message that will be thrown out after an error occurs.
-
Last Error Task Name: The task in which the error occurred.