Fault Processing in a Mediation Flow

Faults are errors that can occur at any point along the mediation path. Faults are caused by the target service while processing messages. Faults can also explicitly occur during a mediation flow to specify that an unhandled case has occurred. The Mediation Flow Editor enables you to specify a fault path for processing to occur when a fault is encountered.

Invoke tasks, like any other task, can generate faults. If an operation referenced by an Invoke activity declares faults, those faults can be caught and processed in the fault path. For example, if the operation declares that it can throw FaultA and FaultB, these faults appear in the Fault Path as faults that can be caught and processed.

  • Faults can occur when receiving the message and creating the mediation flow context.
  • Faults can occur when executing tasks in input or output or fault paths of the mediation flow.
  • Faults can occur when executing the target operation.
An example of fault path


When a fault is encountered, processing of the current path is immediately halted, and control is passed to the fault path. The fault path enables you to catch explicitly declared faults or unhandled faults. However, if a fault is encountered when receiving the message, the mediation flow has not yet started, so the fault is immediately returned to the sender and no fault processing can be done in the mediation flow.

By default, each target operation has one Catch Fault task with sub-paths.

  • A sub-path for each declared fault that can be thrown by the operation.
  • One sub-path to handle any undeclared faults.
  • One sub-path for timeout faults.

There is also one Catch Fault task for faults that occur during processing of the mediation flow.

You can configure each Catch Fault task to have fewer sub-paths, if desired. When you remove sub-paths from a Catch Fault task, the Catch All path is automatically added to catch any faults where there is no specific sub-path for fault handling.

Each sub-path from each Catch Fault task leads to a Send Fault task. The Send Fault task sends a fault back to the original sender of the message. By default, the Send Fault task is configured to send the specific fault caught by the sub-path. You can configure the Send Fault task on a either a target or mediation fault sub-path to send either a generic UndeclaredFault or one of the specific fault messages defined on the mediation operation.

When the fault sent by the Send Fault task does not match the fault caught by the sub-path, a Transform activity is required to transform the fault message into the required format. For faults on the mediation fault path, the Transform activities are added by default, but if you change the configuration of the Send Fault or Catch Fault tasks, you must provide the correct Transform task as well.

You can place mediation tasks along the sub-paths between the Catch Fault activities and Send Fault activities to perform post-fault processing before the fault is returned to the original message sender.

For more information about how to configure the Catch Fault and Send Fault tasks, see Working with Fault Paths.

When faults are encountered while processing tasks in a mediation flow, the execution of the path is terminated, and the control sent to the mediation fault path. This includes faults that occur when processing taks on any of the following paths:

  • Mediation Input Path
  • Mediation Output Path
  • Mediation Reply Path
  • Mediation Target Fault Path

When a fault is encountered on the Mediation Fault Path, the path terminates and a fault is sent to the consumer.