Error Recovery
When something fails, say what happened in plain language, protect the user's work, and offer the most useful next step.
6 states5 edge casesDesktop + Mobile
01The problem
Errors are inevitable: timeouts, server failures, expired sessions, rate limits. Most products handle them with a generic “Something went wrong”, a cleared form, or a full-page error that throws away context. The failure itself is rarely the user's fault, but the lost work and the dead end are what they remember.
02When to use
Use when
- Every request that can fail: saves, loads, actions, uploads
- Long-running operations and integrations
- Session and authentication expiry
Avoid when
- Validation problems with user input — use inline validation.
- Operations where some items succeed — use partial failure.
03Recommended UX
Statecraft recommendation
Contain errors to the smallest part of the page that failed, keep everything the user entered, explain the cause in plain language when it's known, and offer one primary recovery — usually Retry, which retries automatically first for transient failures.
04Desktop behaviour
On desktop, errors appear where the failure happened: inline in a form, inside a failed panel, or as a banner for app-wide issues.
Desktop rules
- Scope: field → component → page → app. Use the smallest that's accurate.
- Message: what happened, what's preserved, what to do.
- Include a short reference ID for support on unexpected errors.
- Session expiry: re-authenticate in a dialog without leaving the page.
05Mobile behaviour
On mobile, errors are more often connectivity-related. Distinguish “no connection” from “server problem”.
Mobile rules
3 mobile rules are included in Pro.
Statecraft Pro
Unlock the full pattern
Get the complete interaction flow, states, edge cases, mobile rules and implementation prompt.
- Interaction flow · 5 steps
- 3 mobile rules
- 6 states
- 5 edge cases with recommendations
- 4 microcopy comparisons
- Accessibility notes
- Developer notes
- Claude Code / Codex implementation prompt
Edge cases covered in this pattern
- Session expired mid-form
- Retry makes things worse
- Repeated failures
- Error in an error state
- Rate limits