Access Keys:
Skip to content (Access Key - 0)
Cancel    
Cancel   

Contents

Exception Type Expression Evaluator Documentation

When there's an error during flow execution MuleMessage is enriched with an ExceptionPayload representing the error. This object can be retrieved using MuleMessage.getExceptionPayload() method and it's useful to take actions after an error. For instance we may want to do routing base on the exception type. To be able to check for exception types we can use exception-type expression evaluator. It compares the exception in the ExceptionPayload against a configurable expression.

Supported expression types

  • #[exception-type:org.mule.example.Exception] - Matches every exception thrown instance of org.mule.example.Exception including subtypes
  • #[exception-type:=org.mule.example.Exception] - Matches every exception thrown instance of org.mule.example.Exception without including subtypes
  • #[exception-type:org.mule.(.*)] - Matches every exception which names matches configured regular expression

In several occasions mule wraps exceptions thrown by dispatchers or componentes. Most likely users will want to evaluate exception-type expressions against wrapped exceptions instead of the wrapper one. To be able to do so, exception-type will evaluate against both exceptions. First it will evaluate against the wrapper and if it evaluates to false, then it will evaluate against the wrapped one, if any.

Common usages

  • Choice exception strategy
  • Exception type filter