Salesforce Decode
Salesforcedecode
Back to questions
LWCAdvancedwizarderror-handlingux

Design LWC error boundary pattern for multi-step wizard

Real World Scenario

Five-step onboarding wizard LWC crashes on step 3 Apex error leaving users stuck with no navigation or retry path.

Expected Answer

• Wrap each step in isolated child LWC catching and surfacing step-level errors • Parent maintains step index and completed steps independent of child crash • Show actionable error panel with Retry and Contact Support options • Persist wizard progress to custom object or session storage for resume • Log correlation Id from Apex errors for support lookup • Disable Next until current step validates; allow Back always • Graceful degrade: skip optional steps when non-critical services fail

Follow-Up Questions & Answers

Click to expand — each follow-up includes a direct, interview-ready answer

Never fail silently. Wrap each step in isolated child LWC catching and surfacing step-level errors. Implement retry with exponential backoff and a dead-letter queue for permanent failures. Wizards are state machines — step navigation must survive individual step component failures. Optimize for scale and operational observability.

Architect Perspective

Wizards are state machines — step navigation must survive individual step component failures.