- Hardware and Software Requirements
- Update Studio
- Command Line Parameters
- Supported Applications and Technologies
- Enabling Gmail for Email Activities
- Opting Out of Telemetry
- Studio Executables
- About Publishing Automation Projects
- Designing Automations
- Managing Activities Packages
- Configuring Activity Project Settings
- Signing Packages
- Importing Entities
- Modern Design Experience
- Linking a Project to an Idea in Automation Hub
- Using the Data Manager
- About Workflow Analyzer
- ST-NMG-001 - Variables Naming Convention
- ST-NMG-002 - Arguments Naming Convention
- ST-NMG-004 - Display Name Duplication
- ST-NMG-005 - Variable Overrides Variable
- ST-NMG-006 - Variable Overrides Argument
- ST-NMG-008 - Variable Length Exceeded
- ST-NMG-009 - Prefix Datatable Variables
- ST-NMG-011 - Prefix Datatable Arguments
- ST-NMG-012 - Argument Default Values
- ST-NMG-016 - Argument Length Exceeded
- ST-DBP-002 - High Arguments Count
- ST-DBP-003 - Empty Catch Block
- ST-DBP-007 - Multiple Flowchart Layers
- ST-DBP-020 - Undefined Output Properties
- ST-DBP-023 - Empty Workflow
- ST-DBP-024 - Persistence Activity Check
- ST-DBP-025 - Variables Serialization Prerequisite
- ST-DBP-026 - Delay Activity Usage
- ST-DBP-027 - Persistence Best Practice
- ST-DBP-028 - Arguments Serialization Prerequisite
- ST-USG-005 - Hardcoded Activity Arguments
- ST-USG-009 - Unused Variables
- ST-USG-010 - Unused Dependencies
- ST-USG-014 - Package Restrictions
- ST-USG-020 - Minimum Log Messages
- ST-USG-024 - Unused Saved for Later
- ST-USG-025 - Saved Value Misuse
- ST-USG-026 - Activity Restrictions
- ST-USG-027 - Required Packages
- ST-USG-028 - Restrict Invoke File Templates
- ST-USG-032 - Required Tags
- ST-USG-034 - Automation Hub URL
- Registering custom services
- Before and After contexts
- Integrating OpenAI with Coded Workflows
- Apply for a loan with UiBank
- Queue generation with coded workflows and Orchestrator APIs
- Using imported library projects in coded automations
- Application Testing
- Test Cases
- RPA Testing
- Execution Templates
- Test Case Templates
- Mock Testing
- API Test Automation
- About extensions
- About the SetupExtensions tool
- Extension for VMware Horizon
- SAP Solution Manager plugin
- Excel Add-in
- About troubleshooting
- Microsoft App-V support and limitations
- Internet Explorer X64 troubleshooting
- Microsoft Office issues
- Identifying UI elements in PDF with Accessibility options
- Repairing Active Accessibility support
- Validation of large Windows-legacy projects takes longer than expected
Global Exception Handler
The Global Exception Handler is a type of workflow designed to determine the project’s behavior when encountering an execution error. Only one Global Exception Handler can be set per automation project.
The Global Exception Handler has two arguments, that should not be removed.
The first argument is
errorInfo with the In direction and it stores information about the error that was thrown and the workflow that failed. The level of the error
to be logged can be set in the Log Message activity.
errorInfoto get the name of the activity which threw the exception and view it in the Output panel.
The second argument,
result has the Out direction and it is used for determining the next behavior of the process when it encounters an error. The following values
can be assigned to the
- Continue - The exception is re-thrown.
- Ignore - The exception is ignored, and the execution continues from the next activity.
- Retry - The activity which threw the exception is retried. Use the
errorInfoto count the number of times the activity is retried.
Abort - The execution stops after running the current Global Exception Handler.Note: Any workflow may be flagged as a Global Exception Handler in Studio, except for library projects.
To control the workflow’s behavior in case of an error, the Global Exception Handler retries the activity three times and then aborts with an error message.
Handling Errors During Debugging
When an exception is detected during debugging, the activity which faulted is highlighted, the execution is paused, and the exception's type and details are mentioned in the Locals and Call Stack panels.
Debugging actions like Continue, Stop, Retry, Ignore, Restart and Slow Step are available in the ribbon. Ignore is used for continuing the execution from the next activity.
The Retry button retries to execute the current activity, without the Global Exception Handler stepping in. The Continue action runs the Global Exception Handler, taking into consideration the previously chosen values for the
result argument, either Continue, Ignore, Retry or Abort.
When using the Global Exception Handler with a project that includes a Try Catch, make sure to group activities into a Sequence inside the Try container. Otherwise, the Global Exception Handler does not execute.
In the case of nested activities, the Global Exception Handler executes for each activity in the call stack. However, it does not execute for activities directly encapsulated in a Try Catch, unless they're contained in an activity.
Example of Using the Global Exception Handler
The following example showcases the project’s behavior when an exception is thrown during execution.
The automation project is set to type some text in a TXT file and then close the application, but not before saving the file.
Creating the Workflow
- Create a Blank Process by following the steps in the Creating a Basic Process page.
- Open Notepad and save a document on your machine. You can name the file
- In the Activities panel, search for Use Application/Browser and drag it to the Designer panel.
- In Use Application/Browser:
Click Indicate application to automate, and then move the mouse pointer to the Notepad window. When the window is highlighted, click anywhere inside it.
The Use Application/Browser activity is updated, the path is added to the Application path field, and a screenshot of the window appears inside the activity.
- In the Properties panel, select the Always option for the Close property. This ensures Notepad is closed after the automation runs.
- Add a Type Into activity in the Use Application/Browser activity’s Do container. Click Indicate in App to select the Notepad window, and add enter a text between quotation marks in the Type this field. This activity writes the text into Notepad.
- From the Activities panel, add a Keyboard Shortcuts activity to the workflow. Indicate the Notepad window, then select Record shortcut and press Ctrl + S to record the key combination that saves the file after the text was typed in.
The resulted workflow should look like this:
Adding a Global Exception Handler
- In the Design tab part of the Ribbon, select New > Global Handler. The New Global Handler window opens. Type in a Name for the handler and save it in the project path. Click Create, a Global Exception Handler is added to the automation project.
- Go back to the workflow you created earlier and modify it so that an activity fails to execute. For example, in the Use Application/Browser activity, select the Match exact title option and make sure the file is closed before you click Run File in the ribbon.
When the Global Exception Handler encounters an exception, it logs the name of the activity which faulted and starts retrying the activity three times. If it encounters the same exception each time and the number of retries reaches 3, the execution is aborted at the level of the activity which threw the exception.
If during one of the retries an exception isn’t encountered, the execution of the workflow continues and the Global Exception Handler doesn’t step in.