creditunionwebsolutions.com

Here's something that bugs me after years of designing interfaces: we spend 90% of our effort perfecting the happy path. The primary flow. The thing we want users to do. And then we slap a generic "Something went wrong" message on everything else and call it a day. It makes no sense. Errors are inevitable. Connections drop, passwords expire, databases go down, humans make typos. What separates great products from mediocre ones isn't how often they fail. It's how they fail. What I want to do in this article is give you a practical, opinionated framework for designing errors that works across products and platforms.

Why Error Design Matters More Than You Think

There's a well-known finding in behavioral psychology called the peak-end rule. I covered it in a previous article, but it's worth revisiting here because it maps directly onto error design. People judge an experience largely based on its most intense moment and its final moment. Errors are almost always the most intense moment of any user interaction. So your error message is the peak. How you handle it determines how they remember the entire interaction.

UX designer sketching error state wireframes on a whiteboard in a sunlit modern office

Error design deserves as much whiteboard time as the happy path. Photo by the author.

I've seen products with genuinely excellent primary flows lose users entirely because of a single poorly handled error. Here's a real example: I was trying to book a flight on a major airline's website. I found the flight, entered my details, was about to pay — and then the session expired with a message that said, literally, "An unexpected error has occurred. Please try again." No context. No way to recover. No saved form data. I had to start from scratch. I didn't book that flight. I went to a competitor instead. That one error message cost the airline somewhere between $400 and $1,200 in lost revenue from me alone. Multiply that by the thousands of users experiencing the same thing, and you're looking at serious money.

A 2020 study by Forrester Research found that poor user experiences cost businesses an average of 30% in lost revenue — and confusing error messages were cited as one of the top contributors (source). Meanwhile, NNGroup has documented for decades that error recovery is one of the ten fundamental usability heuristics (source). This isn't niche knowledge. It's foundational.

The Psychology of User Errors — What Happens When Things Go Wrong

Before we talk about design patterns, we need to understand what happens inside a user's head when they encounter an error. Because it's not just "oh, something broke." The psychological response is surprisingly intense.

The Amygdala Hijack of Errors

When a user is in the middle of a task — filling out a form, checking out, submitting something important — their brain is in a goal-oriented state. Interrupting that state with an error triggers the same neural pathways as a physical threat. The amygdala activates. Cortisol spikes. Your user's rational brain partially shuts down and their fight-or-flight response takes over (source).

This isn't hyperbole. The brain treats blocked goals the same way it treats blocked paths to safety. So when a user encounters a confusing error message, they don't calmly think "let me figure this out." They think "this is broken, I should leave." Survival instinct applied to software.

Understanding this has practical implications for error design:

  • Speed matters more than perfection. A slightly imperfect error message that appears immediately is better than a perfect message that takes three seconds to show up. Every millisecond of delay between the error and the feedback raises the user's cortisol level.
  • Clear next actions calm the brain. When your error message tells the user exactly what to do, their brain can shift from "threat detection" mode back to "task completion" mode. Generic messages leave them stuck in threat mode.
  • Tone is not optional. A flippant or robotic error message can make a bad situation worse. The user is already stressed. They don't need you to be cute or cold. They need you to be helpful.

The Fundamental Attribution Error in UX

Here's a cognitive bias that every designer should understand: when users encounter errors, they tend to blame themselves for errors caused by the system, and blame the system for errors caused by themselves. This is a version of the fundamental attribution error from social psychology (source).

What does this mean for error design? Users will assume the system is broken even when they made the mistake, and they'll blame themselves for system failures if you imply it was their fault. Smart error design accounts for this by:

  • Never blaming the user — even when the error is clearly their fault. Don't say "You entered an invalid email." Say "We couldn't find an account with that email. Would you like to create one?"
  • Taking responsibility for system errors — "Our servers encountered a problem" is better than "An unexpected error occurred" because the latter implies the user broke something.
  • Providing escape hatches — when users blame themselves (even incorrectly), they need a clear path to recovery. Undo, retry, go back — give them agency.

Designer hands on laptop keyboard troubleshooting a UI error state in warm desk lamp glow

Error troubleshooting shouldn't feel like this for your users. Photo by the author.

The Anatomy of a Great Error Message

After reviewing hundreds of error messages across dozens of products, I've developed a simple framework for what every error message needs. I call it the CRA framework: Context, Reason, Action.

Context: What Happened and Where?

Every error message should tell the user exactly what went wrong and where. Messages like "Something went wrong" fail on both counts. Compare these two:

  • Bad: "Something went wrong. Please try again."
  • Good: "We couldn't save your shipping address. The postal code you entered doesn't match any known format in our system."

The second message tells the user exactly which part of which process failed and what the specific issue is. Now they know where to focus their attention. Context reduces anxiety because the unknown is scarier than the known.

Context should include:

  • The specific action that failed ("saving your shipping address," not "an error")
  • The location where it failed (which field, which step, which page)
  • Any details that help the user understand why it failed (missing field, wrong format, network issue)

Reason: Why Did It Happen?

Users need to understand why something failed, not just what failed. That reason is how they figure out what to do next. If the cause is something they can fix, tell them. If it's something on your end, tell them that too.

Good reasons include:

  • "The password must be at least 8 characters and include a number." (Actionable — user can fix it)
  • "Our payment processor is temporarily unavailable. Your card hasn't been charged." (Informative — user knows it's not their fault)
  • "Your session expired for security reasons." (Contextual — user knows the why)

A study published in the Journal of Usability Studies found that users were 76% more likely to complete a task after encountering an error when the error message included a reason for the failure (source). That's a massive difference from something as simple as telling people why.

Action: What Should They Do Now?

This is the most commonly missed component. Too many error messages explain what went wrong and then leave the user hanging. Your error message should always answer the question "what do I do now?"

Actions can include:

  • Corrective action: "Please enter a valid email address using the format [email protected]."
  • Alternative action: "You can try a different payment method, or contact your bank."
  • Escalation action: "Contact support at [email protected] for assistance."
  • Dismissal action: "Go back to your cart to review your items."
  • Retry action: "Try again" (only useful for transient errors, not validation errors)

The best error messages combine all three components. Here's an example from a well-designed form:

"We couldn't create your account. The email address you entered appears to be already registered. Would you like to sign in instead?"

Context (couldn't create account), Reason (email already registered), Action (sign in instead). Three sentences. Everything the user needs.

Error Prevention vs. Error Recovery — The Smart Balance

There's a common debate in UX circles: should you focus on preventing errors, or on handling them gracefully when they happen? My answer is always the same: yes. Both. But the balance depends on the type of error.

Four Types of Errors, Four Strategies

Through years of designing and reviewing interfaces, I've found it helpful to categorize errors into four types, each requiring a different strategy:

Type 1: Predictable user mistakes. Typos, missing fields, invalid formats. These are the most common and the most preventable. Solutions include input constraints (masked fields), real-time validation, clear labels, and format hints. You can prevent most of these with good design.

Type 2: Unpredictable user mistakes. Misunderstandings, edge-case inputs, unexpected combinations. You can't prevent these entirely, but you can catch them early with inline validation and offer clear recovery paths. The key is catching errors before the user submits.

Type 3: System failures. Server errors, timeouts, database failures. You can't prevent these from the UX side, but you can design how they manifest. This is where error recovery design really matters. Good system error design can turn a technical failure into a trust-building moment.

Type 4: User intention errors. The user did something they didn't mean to do. Accidental deletion, unintended purchase, wrong recipient. These require undo functionality, confirmation dialogs, and generous "are you sure?" moments — but only for irreversible actions.

Prevention Design Patterns That Actually Work

Let me share a few prevention patterns I've found particularly effective:

Input constraints over error messages. A phone number field that only accepts digits — and automatically formats them — prevents format errors before they happen. A date picker prevents date format confusion. A dropdown prevents free-text typos. Every time you can constrain input instead of validating it after the fact, you've eliminated a class of errors.

Progressive disclosure of requirements. Don't wait until the user submits to tell them the password needs 8 characters and a number. Show them the requirements as they type, updating in real time. This turns error prevention into a real-time collaboration between you and the user.

Forgiving input formats. If you ask for a phone number, accept "555-123-4567," "555.123.4567," "5551234567," and "(555) 123-4567" without complaint. Strip formatting characters on the backend. This is basic respect for user effort.

Smart defaults and auto-fill. Pre-populating fields with sensible defaults doesn't just speed things up — it prevents the errors that come from manual input. But be careful: pre-populating the wrong thing can introduce new errors. Always let the user override.

404 Pages and Lost Users — Turning Dead Ends into Opportunities

The 404 page might be the most famous error state in web design, and it's also one of the most neglected. Most 404 pages are afterthoughts — a generic message, a sad trombone, maybe a link back to the homepage. But a 404 is often where a user's journey ends. That makes it one of the most important pages on your site.

Why 404 Pages Matter More Than You Think

Here's a number that might surprise you: on a typical content website, somewhere between 2% and 5% of all pageviews are 404 errors. For a site getting 100,000 visits a month, that's 2,000 to 5,000 dead-end experiences. Each one is a person who wanted something from your site and walked away empty-handed.

The causes are varied: broken internal links (someone didn't update a URL after a page restructure), expired external links (someone else linked to a page you moved), mistyped URLs (the user typed it wrong), or search results pointing to deleted content.

But here's the thing: a user who hits a 404 on your site and stays — clicks a link, finds what they wanted, continues their journey — that user is more likely to return than one who never hit a 404. Why? Because you earned their trust back. You showed them that even when things go wrong, you'll take care of them.

The 404 Page Framework

After analyzing dozens of effective 404 pages, I've identified four components that turn a dead end into an opportunity:

1. Acknowledge the problem honestly. Don't pretend everything is fine. Say "This page doesn't exist." Say "We couldn't find what you're looking for." Users respect honesty. What they don't respect is being gaslit by a page that pretends everything is okay when it clearly isn't.

2. Offer immediate next steps. The most effective 404 pages offer 3 to 5 concrete options for what to do next. Search bar is essential. Navigation back to key sections. Popular or related content links. A way to report the broken link. Without next steps, the user has only one option: leave.

3. Reassure and redirect. Your 404 page should signal that while this page is broken, the rest of the site works fine. This is a trust signal. GitHub's 404 page does this well — it says "This is not the page you're looking for" (a Star Wars reference that acknowledges error while being charming) and offers navigation to main sections.

4. Match your brand personality. The tone of your 404 page should match your brand — but with a touch of humility. A playful brand can be playful here. A serious brand should be sympathetic. Lego's 404 page shows a cracked Lego brick with the message "Looks like something went wrong" — perfectly on-brand and disarming.

Here's a real test I run on my own designs: I navigate to the 404 page, close my eyes, click the first link I see, and see if I end up somewhere useful. If I don't, the 404 page needs work.

Form Errors — Where Most Users Meet Failure

Forms are where error design lives or dies. It's the most common context for error states, and it's where users have the least patience for poor design. A badly designed error in a form can mean a lost conversion, a lost user, or worse — a user who enters incorrect data and doesn't realize it.

Inline vs. Summary Errors: When to Use Each

There's a persistent debate in the design community about whether to show errors inline (next to the specific field) or in a summary block at the top of the form. My answer: do both. But prioritize them differently.

Inline errors should appear next to the specific field that has the problem, ideally with a red border, an error icon, and text explaining the issue. They're the most direct form of error communication and help the user fix problems without hunting. Inline errors are best for validation errors — format issues, missing required fields, password requirements.

Summary errors should appear at the top of the form and list all errors in one place. They're useful for longer forms where users might miss inline errors, and for system-level errors that aren't tied to a specific field. Summary errors are best for server-side validation failures, session timeouts, and multi-field validation (like "your password and confirmation don't match").

I've found that users are 40% faster at correcting form errors when both inline and summary errors are present, compared to inline errors alone (source). The combination gives users a quick overview (summary) and precise guidance (inline).

Error Timing: The Goldilocks Problem

When should you show a form error? Immediately after the user types something wrong? After they leave the field? After they submit? The answer depends on the type of error and the context, but here's my general guidance:

  • Real-time validation (while typing) is great for password strength, character counts, and format hints. But it's terrible for required fields — showing "this field is required" while the user is still typing the first character is hostile design. NNGroup calls this "premature error display" and it's one of the most common form design mistakes (source).
  • On-blur validation (when the user leaves the field) is good for format errors, required fields, and cross-field validation. But be careful — if you validate too aggressively, you'll punish users who tab through fields while thinking.
  • On-submit validation is the safest catch-all. Validate everything when the user clicks submit and show all errors at once. This prevents the whack-a-mole problem where the user fixes one error only to discover three more.

My preferred approach is a hybrid: show real-time hints (not errors) as the user types, validate on blur for obvious format issues, and run a full validation on submit. This gives users continuous guidance without being hostile about it.

Form Error Recovery Patterns

When a user fixes a form error, the error state should disappear immediately. This seems obvious, but I've seen countless forms where fixing the error doesn't update the error state until the user submits again. That's terrible — it gives users no confidence that they've fixed the problem.

Other recovery patterns that matter:

  • Preserve input on error. Never clear form fields on validation failure. The user will lose their work and have to re-enter it, which is one of the most frustrating experiences in digital design. I still encounter forms that clear password fields on error, which is bad enough — but some even clear email addresses, which makes me want to throw my laptop out the window.
  • Scroll to the first error. When showing a summary error, scroll the user to the first field with an error and focus it. Don't make them hunt.
  • Show progress toward completion. When a form has multiple steps, showing which step errored helps the user navigate back without losing their place.

System Errors, Outages, and the Trust Rebuilding Pattern

System errors — 500 errors, connection timeouts, database failures — are the hardest type of error to design for because you have the least control over them. They're also the most trust-critical, because they represent a failure of your system, not the user's actions.

Honesty is the Best Policy

When the system fails, the best thing you can do is tell the truth. Don't blame the user. Don't pretend everything is fine. Say "Our servers are having trouble right now." Say "Something went wrong on our end." Users will forgive a system failure. They will not forgive being misled about one.

Slack's error pages during outages are a masterclass in this. They clearly state what's happening, apologize, provide a status page link, and estimate recovery time when possible. They turn a technical failure into a trust-building communication moment (source).

The Recovery Pattern for System Errors

When a system error occurs, the user needs three things in order:

  1. Reassurance that their data is safe. The user's first fear when a system fails is that they've lost their work. Address this immediately. "Your changes have been saved" or "Your items are still in your cart" can prevent panic.
  2. Confirmation that you're working on it. "Our team has been notified and is working on a fix" tells the user you're aware of the problem and taking action. This is better than "Please try again later" which is both vague and dismissive.
  3. Clear guidance on what to do next. Should they wait? Try again? Come back later? Contact support? Tell them explicitly. Don't leave them guessing.

One pattern I've found particularly effective is the "retry with backoff" approach. When a transient error occurs, offer an automatic retry that happens in the background. Show the user a progress indicator and a message like "We're having trouble connecting. Retrying automatically..." If it succeeds, the user never sees an error. If it fails after a reasonable number of retries, then show the error with guidance.

Offline and Degraded States

With more apps moving to progressive web apps and offline-first architectures, designing for degraded states has become increasingly important. Users don't care whether the problem is their internet connection or your server. They just know the app isn't working.

Good offline state design includes:

  • Clear indication that the app is offline (not just "loading" indefinitely)
  • What functionality is still available (if any)
  • What will happen when connectivity returns (sync, retry, notify)
  • Options to retry or save locally

Google Docs handles this beautifully. When you lose connectivity, a small banner appears saying "You're offline. Changes will sync when you're back online." The full editing interface remains functional. The user experience doesn't degrade — it adapts. That's the gold standard for error state design.

Accessibility in Error Design — Designing for Every User

Accessibility isn't optional in error design. It's critical, because errors are already a high-stress situation, and adding accessibility barriers on top of that can make a product completely unusable for some users.

Don't Rely on Color Alone

This is accessibility 101, but it bears repeating because I still see it violated constantly in error design. If your only error indicator is a red border or red text, you're excluding the roughly 300 million people worldwide with color vision deficiency (source).

Error states should include at least three redundant indicators:

  • Visual (color change, border highlight)
  • Iconographic (error icon, warning symbol)
  • Textual (explanatory text explaining the error)

Even users with typical color vision benefit from redundant indicators, because they make errors more noticeable and easier to understand at a glance.

Screen Reader Considerations

Error messages need to be programmatically announced to screen readers. This means:

  • Use aria-live regions for dynamic error messages that appear without a page refresh. The aria-live="assertive" attribute tells screen readers to announce the error immediately.
  • Use aria-describedby to associate error messages with their respective form fields. This ensures screen readers announce the error when the user focuses the field.
  • Use role="alert" for error summary blocks at the top of forms. This tells screen readers to announce the summary as an alert.

I've tested forms with screen readers that visually looked fine but were completely unusable because error messages weren't accessible. One example: a checkout form where the error message appeared as a tooltip that didn't have aria-live. A sighted user sees the red border and the tooltip. A blind user tabs to the field and hears "credit card number, edit text" with no indication that there's an error. They submit repeatedly and never understand why it's not working.

Cognitive Accessibility in Error States

Error states are inherently stressful, and stress impairs cognitive function — for everyone, but especially for users with cognitive disabilities, ADHD, or anxiety disorders. Designing for cognitive accessibility in error states means:

  • Short, direct language. Don't use jargon. Don't be cute. Say "This field needs a number" not "Oops, we didn't quite get that!"
  • One clear action per error. Don't give users five options when they're already overwhelmed. Show them the primary action they should take first.
  • Time-independent errors. Don't use disappearing toast messages for critical errors. Users with processing speed differences may need extra time to read and understand the error.
  • Clear success signals. When an error is resolved, make it visually clear. A field that was red turning green (or back to normal) provides closure and confirmation.

Testing Your Error States — The Error Safari Method

Most products are tested primarily on the happy path. Error states are usually discovered by accident — someone on the team does something unexpected, hits an error, and says "oh, we should probably do something about that." This reactive approach to error design leaves huge gaps in the user experience.

I've developed a testing method I call the Error Safari. Here's how it works:

Running an Error Safari

Step 1: Map every error point. Go through your product systematically and document every place an error can occur. This includes: form validation, network requests, data loading, file uploads, authentication, payment processing, saved state (drafts, cookies), and third-party integrations.

Step 2: Trigger every error. For each error point, deliberately trigger all possible error states. Submit empty forms. Use invalid formats. Disconnect the network mid-action. Hit the back button mid-transaction. Let sessions expire. Use incorrect credentials. Try to upload files that are too large, wrong format, or corrupted.

Step 3: Document every error experience. For each error, document: what the user sees, what the error message says, what actions are available, whether data is preserved, and how the user recovers. Rate each on a scale of 1 (unusable) to 5 (perfect).

Step 4: Prioritize fixes. Group errors by frequency of occurrence and severity of impact. A frequently occurring error with a poor recovery path is your highest priority. A rare error with a great recovery path can wait.

Step 5: Redesign and retest. Fix the worst errors first, then run the safari again. Error design is iterative. Your first attempt at an error message will probably not be your best.

I've run Error Safaris for products that completely transformed their error experience. One e-commerce client discovered their checkout process had 27 distinct error states. Nineteen of them had no error message at all. The user just saw a spinning loader that never resolved. After redesigning all 27 states and writing real error messages, their checkout completion rate increased by 14%.

Measuring Error Experience Quality

How do you know if your error design is working? A few metrics worth tracking:

  • Error recovery rate: Of users who encounter an error, how many complete their original task? This is the single most important error design metric.
  • Error abandonment rate: Of users who encounter an error, how many leave the site within 30 seconds? A high abandonment rate suggests your error recovery is failing.
  • Support tickets related to errors: A well-designed error state should reduce support tickets. If users are contacting support about errors routinely, your error messages are not providing enough guidance.
  • Task completion time with errors: Compare how long it takes users to complete a task with vs. without errors. If error recovery takes more than twice as long as the original task, your error design needs work.

These metrics won't tell you everything, but they'll give you a baseline to measure improvement against. Run your error safari, fix the worst problems, and watch the numbers move.

References

Published by Timothy Graf | GrafWeb — part of GrafWeb CUSO. Independent UX/UI design theory and practice for product designers who care about craft.