Error Handling & Resiliency · Developer / Senior

Error Handling Deep Dive (Continue vs Propagate) — Interview Questions & Scenarios (2026)

On Error Continue vs Propagate, Try scope, standard error types, SAPI→PAPI→XAPI error bubbling, and standardized JSON error payloads.

Mule 4 Error Handling Flow Architecture Diagram showing error propagation, On-Error-Continue and On-Error-Propagate branching, and parent flow response mapping. HTTP Listener POST /api/v1/orders Main Flow Scope Flow-Ref: process-order 💥 Error Thrown (404/500) Error Type? On-Error-Continue Payload = { status: 'handled' } HTTP Status: 200 OK On-Error-Propagate Re-throws error to parent HTTP Status: 500 / 4xx Try Scope with Dedicated Error Handler Allows localized transaction rollback or fallback cache retrieval without terminating the main thread. ✓ Error contained inside Try -> Parent flow continues execution.
Figure L.1: Mule 4 Error Handling Scopes — On-Error-Continue (HTTP 200) vs On-Error-Propagate (HTTP 500) & Try Scope Isolation.

⚠️ Error Handling Deep Dive (Continue vs Propagate)

On Error Continue vs Propagate, Try scope, standard error types, SAPI→PAPI→XAPI error bubbling, and standardized JSON error payloads.

BEHAVIOR ON ERROR CONTINUE ON ERROR PROPAGATE
HTTP Status Code Returns 200 OK (success to caller) unless overridden Returns 500 Internal Server Error (or error mapping)
Parent Flow Execution Parent flow continues to the very next processor Parent flow execution immediately terminates
Transaction Behavior Commits current database/JMS transaction Rolls back transaction (compensates changes)
Payload Returned Output of the error handler scope becomes the new payload Output of error handler is sent back as error body
Best Fit Production Scenario Optional fallback calls (e.g. cache lookup, default promo) Critical financial transfers, order placements, ACID ops
🔥
Interactive Error-Handling Flow Simulator
Solve MuleSoft's #1 interview trick question: trace HTTP:CONNECTIVITY across Try Scope, Private Flow & Main Flow.
MULE 4 RUNTIME ENGINE
Presets:
HTTP Listener
POST /api/orders
Entry Point
Main Flow
Calling Logic
Propagate
Flow Ref
Calls Private Flow
Sync Handoff
Private Flow
Child Sub-Process
None
Try Scope
Error Boundary
Continue
Error Thrown Here
HTTP:CONNECTIVITY
Origin Point
Select error handlers above or pick a preset, then click "Throw Error - Simulate HTTP:CONNECTIVITY" to trace execution.
🎭 Role-Based Analysis & Simulation Results Switch roles to tailor the exact same simulation result for any stakeholder
💻 DEVELOPER VIEW HTTP 200 OK · Technical Trace
Mule 4 Runtime Execution: Try Scope's On Error Continue catches HTTP:CONNECTIVITY, logs it locally, and sets the Mule Event payload to recovery JSON. Execution resumes at the next processor and returns HTTP 200 OK.
1. FINAL HTTP STATUS
200 OK
Try Scope caught HTTP:CONNECTIVITY with On Error Continue and returned a success message to Private Flow and Main Flow.
2. NEXT PROCESSOR
YES — Runs
Try Scope catches and swallows the error via On Error Continue, so subsequent processors run normally.
3. FINAL PAYLOAD RETURNED TO CALLER
"Success — Main Flow completed using Try Scope On Error Continue recovery payload"
4. 1-LINE INTERVIEW RULE
"On Error Continue inside a Try Scope swallows the error and returns a success event, so both Private Flow and Main Flow continue executing and the caller receives HTTP 200 OK."
💰 Business Impact Calculator Estimate 1-hour revenue impact if this error occurs in production
If this error happens for 1 Hour, Business Loss = Rs 0
Orders continue completing via fallback handling (HTTP 200 OK) — zero immediate hourly checkout revenue loss.
Q1 [DEVELOPER / SENIOR] ⏱️ 1 min read Module L

What is the difference between On Error Continue and On Error Propagate?

⚡ Self-Test Mode Ready
✓ ANSWER
ASPECTON ERROR CONTINUEON ERROR PROPAGATE
After handler executesFlow continues normally, returns success responseError propagates to parent scope/caller
HTTP response code200 (success) unless you change vars.httpStatusError code (4xx/5xx) propagated to caller
Use forExpected business errors — transform to business responseUnexpected errors — let caller know something went wrong
ExampleSAP record not found → return empty response gracefullyDB connection failed → return 503 to API consumer

Enterprise Error Handler Pattern

🎯🎯 Interview Pitch - Say It Like This (30 Sec)
"My philosophy on enterprise error handling is structured around predictability and actionable observability. I design a centralized Global Error Handler using On Error Propagate for unexpected system exceptions to guarantee transaction rollbacks and standardized HTTP 5xx responses, while using On Error Continue inside Try scopes for anticipated business fallbacks—always ensuring correlation IDs and structured JSON schemas are propagated."
💼💼 Real-Time Project Example

Project: Insurance — Core Integration Gateway.

Problem: Unhandled downstream 503 errors and connection timeouts were returning generic, unhelpful HTML error pages to frontend clients with zero traceability.

What I Did: Created an enterprise global error handler mapping HTTP:CONNECTIVITY, HTTP:TIMEOUT, and MULE:EXPRESSION to RFC 7807 Problem Details JSON, preserving X-Correlation-ID across all layers.

Result: Decreased mean time to resolution (MTTR) by 55% across support teams and ensured 100% consistent error responses across 20+ microservices.

Q2 [DEVELOPER / SENIOR] ⏱️ 1 min read Module L

What is a Try Scope? When do you use it?

⚡ Self-Test Mode Ready
✓ ANSWER

Try Scope provides localized error handling for a specific group of processors within a flow. Errors in

the Try scope are caught there — they don't propagate to the flow's error handler unless you use on-

error-propagate inside the Try scope.

When to use: When you need different error behavior for one specific part of a flow (e.g., retry a

single DB call while letting the rest of the flow succeed). ForEach uses Try scope around each record

to prevent one failure from stopping the loop.

🎯🎯 Interview Pitch - Say It Like This (30 Sec)
"My philosophy on enterprise error handling is structured around predictability and actionable observability. I design a centralized Global Error Handler using On Error Propagate for unexpected system exceptions to guarantee transaction rollbacks and standardized HTTP 5xx responses, while using On Error Continue inside Try scopes for anticipated business fallbacks—always ensuring correlation IDs and structured JSON schemas are propagated."
💼💼 Real-Time Project Example

Project: Aviation — Core Integration Gateway.

Problem: Unhandled downstream 503 errors and connection timeouts were returning generic, unhelpful HTML error pages to frontend clients with zero traceability.

What I Did: Created an enterprise global error handler mapping HTTP:CONNECTIVITY, HTTP:TIMEOUT, and MULE:EXPRESSION to RFC 7807 Problem Details JSON, preserving X-Correlation-ID across all layers.

Result: Decreased mean time to resolution (MTTR) by 55% across support teams and ensured 100% consistent error responses across 20+ microservices.

Q3 [DEVELOPER / SENIOR] ⏱️ 1 min read Module L

What are the standard MuleSoft error types?

⚡ Self-Test Mode Ready
✓ ANSWER
ERROR TYPECAUSETYPICAL RESPONSE
HTTP:NOT_FOUNDHTTP 404 from downstreamReturn empty response or 404
HTTP:UNAUTHORIZEDHTTP 401 — auth failedReturn 401 or refresh token and retry
HTTP:CONNECTIVITYCannot connect to hostReturn 503 with Retry-After header
HTTP:TIMEOUTResponse timeout exceededReturn 504 Gateway Timeout
MULE:EXPRESSIONDataWeave transform error or null pointerReturn 400 Bad Request
MULE:RETRY_EXHAUSTEDUntil Successful max retries reachedAlert ops + DLQ + return 503
APIKIT:NOT_FOUNDNo matching API route in RAMLReturn 404 — endpoint not defined
ERROR TYPECAUSETYPICAL RESPONSE
ANYCatch-allLog + return 500
🎯🎯 Interview Pitch - Say It Like This (30 Sec)
"My philosophy on enterprise error handling is structured around predictability and actionable observability. I design a centralized Global Error Handler using On Error Propagate for unexpected system exceptions to guarantee transaction rollbacks and standardized HTTP 5xx responses, while using On Error Continue inside Try scopes for anticipated business fallbacks—always ensuring correlation IDs and structured JSON schemas are propagated."
💼💼 Real-Time Project Example

Project: Energy & Utility — Core Integration Gateway.

Problem: Unhandled downstream 503 errors and connection timeouts were returning generic, unhelpful HTML error pages to frontend clients with zero traceability.

What I Did: Created an enterprise global error handler mapping HTTP:CONNECTIVITY, HTTP:TIMEOUT, and MULE:EXPRESSION to RFC 7807 Problem Details JSON, preserving X-Correlation-ID across all layers.

Result: Decreased mean time to resolution (MTTR) by 55% across support teams and ensured 100% consistent error responses across 20+ microservices.

Q4 [DEVELOPER / SENIOR] ⏱️ 1 min read Module L

How do you propagate an error from SAPI to XAPI through PAPI?

⚡ Self-Test Mode Ready
✓ ANSWER

Use on-error-propagate at each layer. The error message (and payload) propagates up the call chain

automatically.

Enterprise Pattern: SAPI catches SAP HTTP error → builds standardized error payload {correlationId,

errorCode, message, layer:"SAPI"} → propagates. PAPI receives error → enriches with PAPI context →

propagates. XAPI receives error → formats final API error response with correct HTTP status code →

returns to caller.

The key: use a consistent error response format at every layer so the XAPI always knows what shape

the error payload will be regardless of which layer it originated from.

🎯🎯 Interview Pitch - Say It Like This (30 Sec)
"My philosophy on enterprise error handling is structured around predictability and actionable observability. I design a centralized Global Error Handler using On Error Propagate for unexpected system exceptions to guarantee transaction rollbacks and standardized HTTP 5xx responses, while using On Error Continue inside Try scopes for anticipated business fallbacks—always ensuring correlation IDs and structured JSON schemas are propagated."
💼💼 Real-Time Project Example

Project: Retail & E-Commerce — Core Integration Gateway.

Problem: Unhandled downstream 503 errors and connection timeouts were returning generic, unhelpful HTML error pages to frontend clients with zero traceability.

What I Did: Created an enterprise global error handler mapping HTTP:CONNECTIVITY, HTTP:TIMEOUT, and MULE:EXPRESSION to RFC 7807 Problem Details JSON, preserving X-Correlation-ID across all layers.

Result: Decreased mean time to resolution (MTTR) by 55% across support teams and ensured 100% consistent error responses across 20+ microservices.

Q5 [DEVELOPER / SENIOR] ⏱️ 1 min read Module L

What is the standard error response format you use across all Enterprise APIs?

⚡ Self-Test Mode Ready
✓ ANSWER

DataWeave — Standard Error Response

DWL
%dw 2.0
output application/json
---
{
correlationId: vars.correlationId,
timestamp: (now() >> "America/New_York") as String {format: "yyyy-MM-dd HH:mm:ss"},
status: vars.httpStatus,
errorCode: "SAP_TIMEOUT",
message: "Upstream SAP system unavailable",
details: error.description,
apiName: "orders-portal-xapi",
apiVersion: "v2.0.0"
}

This format is enforced by the global-config.xml default error handler. Frontend teams never see raw Java/SAP exceptions — always wrapped in this format. Operations filter Splunk by errorCode. correlationId links to full request trace.

🎯🎯 Interview Pitch - Say It Like This (30 Sec)
"My philosophy on enterprise error handling is structured around predictability and actionable observability. I design a centralized Global Error Handler using On Error Propagate for unexpected system exceptions to guarantee transaction rollbacks and standardized HTTP 5xx responses, while using On Error Continue inside Try scopes for anticipated business fallbacks—always ensuring correlation IDs and structured JSON schemas are propagated."
💼💼 Real-Time Project Example

Project: Commercial Banking — Core Integration Gateway.

Problem: Unhandled downstream 503 errors and connection timeouts were returning generic, unhelpful HTML error pages to frontend clients with zero traceability.

What I Did: Created an enterprise global error handler mapping HTTP:CONNECTIVITY, HTTP:TIMEOUT, and MULE:EXPRESSION to RFC 7807 Problem Details JSON, preserving X-Correlation-ID across all layers.

Result: Decreased mean time to resolution (MTTR) by 55% across support teams and ensured 100% consistent error responses across 20+ microservices.

← Choice Router, First Successful & Async ScAnypoint MQ Deep Dive (Queues, Exchanges, →