Try-Catch

Try-Catch activity

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:

  1. Drag the activity from the toolbox pane and drop it in the Designer pane.
  2. In the properties pane, type a name and description of the activity.
    The name and description editors
  3. In the Connection Profile property box, select the repository you want the activity to use.
  4. Drag the activities you want to attempt and drop them into the Try Branch.
  5. Drag the activities you want to catch and drop them into the Catch Branch.
  6. Select the Catch Branch.
  7. 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:
      1. Click the Browse button (ellipsis) to browse to an exception type.
      2. 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.
      3. Click OK.

To delete a catch branch:

  1. Select a branch in the designer pane to highlight it.
  2. Click the Delete Selected Activity button in the toolbar.
You may want to disable branches if you only want to test specific sections of your workflow. To disable branches:Select a branch in the designer pane to highlight it.In the Description property box, clear Enable.