Throw

This activity is used to notify the exception message and terminate the process. It explicitly throws an exception that is defined by the user. Once the bot reaches the throw activity, it throws the exception message and ends the workflow.

Technical Reference:

 

 

 

 

 

MISC

Display name: Displays the name of the activity. You can also customize the activity name to help troubleshoot issues faster. This name will be used for logging purposes.

Exception: Define the exception rule to display during the runtime. It gets displayed in the Output window.

*Mandatory field to execute the workflow

Example:

The following activity explains how we are going to use the Throw activity in a simple workflow.

Here we are going to automate and throw an exception.

1.      Drag and drop the Get Excel Object activity from the Excel Automation.

2.      Select the file path where you have stored the Excel sheet.

3.      Add Set Cell Color activity inside the Get Excel Object activity.

4.      Set the cell range and color from the properties panel.

5.      Add delete worksheet and specify another Worksheet from the excel sheet.

6.      If you execute the workflow, the bot sets the color and delete the specified worksheet in the excel.

Now add Throw from error handling activity before the Delete worksheet activity.

Enter the exception as New Exception(“The specified worksheet cannot be deleted.”).

Now, execute the workflow.

The bot stops the execution and throws an error in the output box which says that “The specified worksheet cannot be deleted”.