I am in the process of introducing Error handling support in Synapse (as per http://wiki.apache.org/incubator/Synapse/InProgress/Features_and_Design) and hope to commit this into the svn ASAP.

Error handling would be possible through the two methods as given below.

1. Sequences

A sequence would be able to specify another sequence as its error handler. If the execution of the sequence now causes an error, it would be caught, and an error code, error message and error detail stored into the message context, and the error handler sequence invoked. So far I have not defined error codes, but would value comments on the following categories and any specifics you would like us to capture. - Transport errors - Axis faults
   - Security
   - Registry access
   - General errors

The syntax for the sequences would now be as shown below, where the onError attribute would specify the name of another sequence

<sequence name="string" [onError="string"]>
   ....
</sequence>

Note:
A sequence reference will not be able to override the error handler already defined on the sequence definition. If a sequence does not provide an error handler, or the error handler itself throws another exception, the parent sequences' error handler would be invoked. The message context would only keep information about the *last* exception, and a new exception would overwrite any previous information
2. Try mediator

The new Try mediator would be similar to the Java try-catch-finally where the catch clause traps all exceptions. Its syntax would be
<try>
   <sequence>
      mediator+
   </sequence>
   <onError>
      mediator+
   </onError>
   <finally>
      mediator+
   </finally>?
</try>

The Try mediator is a List mediator, but with two additional lists of mediators to be invoked on an error, and finally. The finally block is optional to the mediator.

asankha


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to