Interface IErrorMessageFormatter

All Known Implementing Classes:
DataSonnetErrorMessageFormatter, ErrorMessageFormatter, FixedErrorMessageFormatter, SoapErrorMessageFormatter, XslErrorMessageFormatter, Y01ErrorMessageFormatter

@FrankDocGroup(ERROR_MESSAGE_FORMATTER) public interface IErrorMessageFormatter
An errorMessageFormatter is responsible for returning a message describing the error at hand in a format that the receiver expects.

ErrorMessageFormatters are configured on Adapters or Configurations to format exception messages when an exception is thrown during the PipeLine execution process.

The ErrorMessageFormatter is called when a IPipe throws an exception, and has an exceptionForward. The target of the exceptionForward will receive the message produced by the ErrorMessageFormatter.

The ErrorMessageFormatter is also called when any exception occurs during pipeline execution that is not caught or handled by an exceptionForward. Request-Reply receivers configured with FORMAT_AND_RETURN will then return the formatted error message as the pipeline result.

If you want to return a specific error message from a pipeline to signal a (functional) error condition that did not result from an exception, use an ExceptionPipe to trigger an exception. This exception will then result in the ErrorMessageFormatter being called. You can use IParameters on the ExceptionPipe to pass specific information to the ErrorMessageFormatter such as error codes, error messages, etc. See the example message layouts in ErrorMessageFormatter to see how parameters are available in the XML or JSON error message. Parameters from the ExceptionPipe are also copied into the PipeLineSession.

When no specific ErrorMessageFormatter is configured on the Adapter or its Configuration, the default implementation ErrorMessageFormatter is used with a default XML format. For more control over the layout of the message, configure a XslErrorMessageFormatter or DataSonnetErrorMessageFormatter.

If these do not provide enough control over the error message format for your adapter, you can provide a custom implementation of this interface as custom code in your configuration.

Author:
Johan Verrips