Exception Handling Automation
Exception Handling is an activity group designed to gracefully handle exception that might occur when running a bot so that the typical workflow of the RPA Model can be maintained. An exception in RPA bot execution can be defined as any event or error that generally disrupts the typical workflow of the RPA Model.
Since RPA bots are generally run in unattended mode, a key advantage of Exception Handling activities is to help continue the processing of the bot when a runtime error occurs, so that the user does not have to manually restart or rerun the bot to complete rest of the automation tasks.
You can use these activities to perform the following types of task:
- Hold an activity that might cause an exception.
- Hold an activity that would be executed if no error occurs or an error is already identified.
- Log custom message in the log file when an error occurs.
- Defines how the workflow is executed or processed if an error is encountered.
- Take a screenshot of the screen when an error occurs and then save it to a file.
- Start the new task or activity when an error occurs.
- Add a block of activities between the advanced error handling activities (with Try and End Try type) to monitor if the activities cause any exception.
Exception Handling Activities
The Exception Handling group includes the following activities:
The Advanced Error Handling activity helps you to control the workflow of the bot based on the type of exception that a bot encounters during execution.
This activity enables you to separate the activities that might cause an exception from the activities that you want to use to handle an exception. This usage means that you can also test specified activities for exception when the bot is executed, specify activities that would be executed when an exception occurs, or specify activities that would help you to handle the exception.
Properties
- Name: Enter the display name of the activity.
- Instance Name: Specify a unique name to identify the group of activities inside the Try, Catch, Finally, and End Try activities.
- Choose Handling Type: Select one of the following handling types:
- Try: This activity represents the start of the Exception Handling flow in an RPA Model. It enables you to specify a set of activities that might throw an error when executed. If the bot encounters an error when executing the activities in the Try group, it moves to the Catch activity block activities and tries to run them.
- Catch: This activity lets you specify a different set of activities (or replacement activities) if the bot encounters an error when running the activities in the Try activity block. You can also specify the following properties for the Catch activity:
- Custom Message:
(Optional)
Specify a custom message for the exception. The message is added to the execution log when the bot encounters an error when running the Try block activities. - Take Screenshot: Toggle the button if you want to capture a screenshot of the window or application when the execution error occurs.
- Store Into File:
(Optional)
Specify the full path to store the screenshot of the error or the filename for the screenshot. If you have specified only the filename, the screenshot, by default, is saved in thePictures\Screenshots\RPA_BOT_ERRORS
folder. The filename of screenshot also contains timestamp. Example filename:Error15062020031913614.png
. The screenshot file is saved only in the PNG file format.
- Custom Message:
- Finally: This activity enables you to specify the activities you want to execute irrespective of whether the bot encounters an error or not. For example, automation tasks such as closing the database connection or an open file are performed by the Finally activity block.
- End Try: This activity represents and used to end the Exception Handling flow.
Refer the flowing Advanced Error Handling activity flowchart:
Use the Error Handling activity to specify if you want to continue or stop the processing of the automation task execution workflow if an error is encountered. This helps you to complete the automation task workflow even if an error occurs with activity.
Properties
- Name: Enter the display name of the activity.
- Select Task: Select one of the following actions:
- Stop Processing: The execution of the workflow stops, and bot execution error is displayed.
- Continue Processing: The error is ignored, and the workflow execution continues with the next activity or starts a new activity.
- Take Screenshot: Toggle the button if you want to capture a screenshot of the window or application when the execution error occurs.
- Store Into File:Specify the full path to store the screenshot of the error or the filename for the screenshot. If you have specified only the filename, the screenshot, by default, is saved in the
Pictures\Screenshots\RPA_BOT_ERRORS
folder. The filename of screenshot also contains timestamp. Example filename:Error15062020031913614.png
. The screenshot file is saved only in the PNG file format.