Using the ThrowActivity Activity
The purpose of the ThrowActivity activity is to raise exceptions declaratively, usually in response to exceptional conditions detected in a workflow.
The ThrowActivity activity can point to an exception object in the workflow that is derived from Exception, using the Fault property; if the Fault property is set to a specific exception instance, setting the FaultType property is not required. The execution of the ThrowActivity activity throws the exception object in the .NET Framework sense, which is using the C# throw statement. This is equivalent to a code handler of an activity throwing the exception in user code.
For a code sample that demonstrates how to use the ThrowActivity activity, see Using Throw.