Skip to main content
Version: 4.4.0

Error Handling

Exception handling

Workflows use exceptions for error handling to help dealing with unexpected or exceptional situations. If selected, Exception handling uses the TryCatch activity to handle failures. All activities throw exceptions on failure if not configured differently.

The TryCatch activity

The TryCatch activity is a container activity consisting of several blocks; one Try block that holds the logic to execute, zero or multiple Catch blocks to catch and handle exceptions and optionally one Finally block that is always run before completion of the TryCatch activity. The Finally part is a good place to add clean-up logic.

TryCatch activity with one error handler and a finally handler.

The Throw and Rethrow activities

There are two activities available to directly throw an exception from within the Workflow logic: The Throw and Rethrow activities. The Throw activity can be used anywhere inside a Workflow. The Rethrow activity must be used in the catch block of the TryCatch activity.

Unhandled exceptions

If an exception is not caught in a Workflow logic the executing Job for the Workflow instance will fail and a log entry is added with the description of the exception.

See Also

Microsoft WF activities