Try-Catch
This activity specifies a sequence of activities to perform (in a try branch) and additional activities to perform (in a catch branch) if an activity in the try branch encounters an error. This prevents the workflow from terminating due to the error. The Rethrow activity recreates the error that started a Try-Catch activity's catch branch. Learn about tokens this activity produces.
To set up this activity:
- Drag the activity from the toolbox pane and drop it in the Designer pane.
- In the properties pane, type a name and description of the activity.

- In the Connection Profile property box, select the repository you want the activity to use.
- Drag the activities you want to attempt and drop them into the Try Branch.
- Drag the activities you want to catch and drop them into the Catch Branch.
- Select the Catch Branch.
- In the Error Type property box, select the error type to cause the Catch Branch to run.
- All Errors: The Catch Branch will run if the try branch encounters any error.
- Only errors of type: The Catch Branch will run only if the try branch encounters a specified type of error. To specify the type of error:
- Click the Browse button (ellipsis)
to browse to an exception type. - Select an error type by expanding a node. If you cannot find the error type, type the assembly qualified name of the exception type in the text box.
- Click OK.
- Click the Browse button (ellipsis)
To delete a catch branch:
- Select a branch in the designer pane to highlight it.
- Click the Delete Selected Activity button
in the toolbar.
Tokens for Try-Catch Activity
This activity produces the following tokens:
| Name | Description | Sample Syntax |
|---|---|---|
| Error Code | The error code of the error encountered in the try branch. | %(CatchBranch_Error Code) |
| Message | The error message of the error encountered in the try branch. | %(CatchBranch_Message) |
| Actual Type | The name of the exception encountered in the try branch. | %(CatchBranch_Actual Type) |
| Actual Type Full | The namespace-qualified name of the exception encountered in the try branch. | %(CatchBranch_Actual Type Full) |
The "CatchBranch" portion of the syntax changes to match the catch branch's name.
Note: All non-alphanumeric characters, except underscores, are removed from the name. For example, if you rename the catch branch, "Exception--Handler", the syntax for the Error Code token will be "%(ExceptionHandler_Error Code)".