Throw action in Error handler

Use the Throw action in the Error handler package to create an error condition, which will immediately shift the bot execution to the Catch action.

If a logical error occurs in the Try action, you can use the Throw action to create an error condition, which will immediately shift the bot execution to the Catch action. You can edit the Throw action properties to set the error message to be sent to the Catch action. Outside of a Try action, the Throw action causes a standard error dialog box to be displayed, requiring a user to manually click the Close button to dismiss it.

Consider a scenario where your bot is reading data from a spreadsheet that contains employee IDs in column A. If there is an empty row or an invalid employee ID, the Throw action will trigger the Catch block to record the error. The Try, Catch, and Finally actions can be used within a loop. This ensures that capturing such errors does not have to necessarily stop the processing of the entire automation. Instead, just stop the processing of that one data record and log the error.

Settings

  • (Optional) Use the Please enter exception message field to enter a message that must be displayed when the bot encounters an error.

    You can also click the Insert a variable icon to select an existing variable.

  • Use the Exception drop-down to select a botexception.