Catch Branches
In the Try-Catch activity, a catch branch runs if an error occurs in the try branch. The activity contains two branches by default: a try branch and a catch branch.
Tip: You can add more catch branches.
To configure a catch branch
- Add the Try-Catch Activity to your workflow definition by dragging it from the Toolbox Pane and dropping it in the Designer Pane.
- Select the catch branch in the Designer Pane.
- In the Properties Pane, in the
Error Type property box, select which types of errors will cause the catch branch to run.
- All Errors: The catch branch will run if the try branch encounters any error.
- Only Laserfiche Server errors: The catch branch will run only if the try branch encounters a Laserfiche Server error. Learn more about Laserfiche Server errors.
- Custom error type: The catch branch will run only if the try branch encounters a specific type of error.
To configure a custom error type
- Click the Browse button (ellipsis)
to open the
Error Type Browser.
- Select an error type by expanding a node under Exception Browser and clicking the error type.
- Optional: If you cannot find the error type you want in the Error Type Browser dialog box, type the assembly qualified name of the exception type in the Assembly Qualified Name text box.
- Click OK.
Note: To use the same custom error for another catch branch, copy the assembly qualified name from the Error Type Browser dialog box or from the read-only text box under Custom error type in the property pane. Paste the error into the other catch branch's Assembly Qualified Name text box in that branch's Error Type Browser dialog box.
- Drag and drop activities into the branch.
Note: Catch branches cannot be canceled or terminated by other activities, such as the Deadline activity. If you place a Try-Catch activity inside the primary branch of a Deadline activity, and the deadline is reached, than the deadline branch will start and run in parallel with the catch branch. When the catch branch completes, the primary branch will be canceled. You can terminate a running catch branch manually, or by using the End Workflow activity.
Tokens for Catch Branch
The catch branch of the Try-Catch activity produces the following tokens, available only within the catch branch.
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 as specified in the Activity Name property box. Note that 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).