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.
⚠️ 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 |
HTTP:CONNECTIVITY across Try Scope, Private Flow & Main Flow.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.
"Success — Main Flow completed using Try Scope On Error Continue recovery payload"
What is the difference between On Error Continue and On Error Propagate?
| ASPECT | ON ERROR CONTINUE | ON ERROR PROPAGATE |
|---|---|---|
| After handler executes | Flow continues normally, returns success response | Error propagates to parent scope/caller |
| HTTP response code | 200 (success) unless you change vars.httpStatus | Error code (4xx/5xx) propagated to caller |
| Use for | Expected business errors — transform to business response | Unexpected errors — let caller know something went wrong |
| Example | SAP record not found → return empty response gracefully | DB connection failed → return 503 to API consumer |
Enterprise Error Handler Pattern
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.
What is a Try Scope? When do you use it?
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.
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.
What are the standard MuleSoft error types?
| ERROR TYPE | CAUSE | TYPICAL RESPONSE |
|---|---|---|
| HTTP:NOT_FOUND | HTTP 404 from downstream | Return empty response or 404 |
| HTTP:UNAUTHORIZED | HTTP 401 — auth failed | Return 401 or refresh token and retry |
| HTTP:CONNECTIVITY | Cannot connect to host | Return 503 with Retry-After header |
| HTTP:TIMEOUT | Response timeout exceeded | Return 504 Gateway Timeout |
| MULE:EXPRESSION | DataWeave transform error or null pointer | Return 400 Bad Request |
| MULE:RETRY_EXHAUSTED | Until Successful max retries reached | Alert ops + DLQ + return 503 |
| APIKIT:NOT_FOUND | No matching API route in RAML | Return 404 — endpoint not defined |
| ERROR TYPE | CAUSE | TYPICAL RESPONSE |
|---|---|---|
| ANY | Catch-all | Log + return 500 |
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.
How do you propagate an error from SAPI to XAPI through PAPI?
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.
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.
What is the standard error response format you use across all Enterprise APIs?
DataWeave — Standard Error Response
%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.
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.