Handling Errors8% of the exam

Error matching order and error type hierarchy

How an Error Handler with several On-Error components picks one: first match in order of appearance, by type list, parent type and when condition, plus which errors (CRITICAL) no handler can catch and what happens when nothing matches.

Official exam objective
Apply correct processors/syntax to combine multiple error handlers, and predict outcomes.

~6 min read · 5 practice questions ·

What the exam expects

  • Order several On-Error components in one Error Handler so a specific error is caught before a broader one.
  • Predict which component handles an error given type lists, parent types and when conditions.
  • Name the parent types that match a given error type (for example HTTP:UNAUTHORIZED).
  • Identify the errors that no On-Error component can handle, and predict the outcome when no component matches.

Key terms:

  • Error type: NAMESPACE:IDENTIFIER, such as HTTP:NOT_FOUND; runtime errors have an implicit MULE namespace.
  • Parent type: a broader type in the hierarchy that also matches its children, such as MULE:SECURITY for HTTP:UNAUTHORIZED.
  • when condition: a matching expression that must evaluate to true for the component to match.
  • ANY and CRITICAL: the two roots; everything under ANY can be handled, nothing under CRITICAL can.

Key facts

Which component runs
Detail
The first one that matches, in order of appearance
type attribute
Detail
Comma-separated list of Mule error types
when attribute
Detail
Matching expression that must evaluate to a boolean (true or false)
Implicit namespace
Detail
EXPRESSION = MULE:EXPRESSION
HTTP:UNAUTHORIZED ancestors
Detail
MULE:CLIENT_SECURITY, then MULE:SECURITY, then ANY
Unhandleable errors
Detail
CRITICAL (OVERLOAD, FATAL_JVM_ERROR), only logged
UNKNOWN
Detail
Not handled directly, only through ANY
No component matches
Detail
Default error handling logs and propagates
Propagated error at an HTTP Listener
Detail
500 with the error description as body
Sources for this section (3)
  • Why does a handler for ANY also catch RETRY_EXHAUSTED?
  • Why is UNKNOWN handled only through ANY and not by its own On-Error component?
  • Why does a custom type such as ORDER:INVALID_DATA still match a handler of type ANY?
  • When does Mule raise COMPOSITE_ROUTING?

The questions are free to read. Answers with their sources and self-grading are included with the pack.

Keep reading with the MuleSoft Developer pack

  • Core concepts
  • Exam traps
  • Worked scenario

The pack includes:

  • All 40 lessons of the MuleSoft Developer guide, with reading progress
  • Interactive decision walks and step-by-step sequence steppers
  • Practice exams purchase adds inline bank questions and topic practice (5 questions for this lesson)
  • An official source cited for every claim
  • An AI tutor that answers from the guide
  • Unlimited timed practice exams

Practice for the MuleSoft Developer exam