Sub topic 9
Error Messages That Help Users Recover
This chapter assumes you know common interface elements (forms, dialogs, inline messages) and have read the earlier chapters on plain language, voice and tone, and form copy. Here you apply those ideas to the moment when something goes wrong.
An error message has one job: help the person get back on track. Everything else, including apologizing, explaining the system, or showing a code, is secondary.
Why error messages deserve special attention
Users meet errors when they are already stuck. They are interrupted, often a little annoyed, and they need a next step. A weak message makes them guess. A good one lets them fix the problem in seconds.
Error messages are also where product quality shows. Many are written by developers as log output and shipped unchanged. Your job is to turn "what the system detected" into "what the user can do."
The three parts of a useful error message
Most useful error messages answer three questions:
- What happened? State the problem in plain words.
- Why, if it helps? Include the cause only when it changes what the user does.
- What now? Give a specific action, or the expected format.
You do not always need all three. A short field error often combines them into one sentence. The example from the plan shows this:
Before: Error 422: Invalid input in field.
After: Enter an email address like [email protected].The rewrite drops the error code, says what is wrong, and shows the expected format so the user can fix it right away. The "Before" version fails all three tests. It names no field, gives no reason, and offers no action.
What to leave out
- Internal codes and stack traces. Move them to a "Details" disclosure or a support reference line if support staff need them.
- Blame. "You entered an invalid date" points at the user. "Enter a date in the format DD/MM/YYYY" points at the fix.
- Vague words. "Something went wrong" and "Invalid input" tell the user nothing.
- Humor in serious failures. A joke is risky when the user has just lost work or a payment failed.
Match the message to the type of error
Different errors need different copy. Identify the type first, then write.
| Error type | Cause | What the message must do | Example |
|---|---|---|---|
| Validation | The user's input is missing or malformed | Say which field and what is expected | Enter a password with at least 8 characters. |
| Permission | The user lacks access | Say what is blocked and who can grant access | You can view this file but not edit it. Ask the owner for edit access. |
| Not found | The page or item does not exist | Say what is missing and offer a path forward | We can't find that page. Go to your dashboard or search for it. |
| System or network | The product or connection failed | Say whether the user's work is safe and what to try | We couldn't save your changes. Your draft is still here. Check your connection and try again. |
| Conflict | Two states disagree | Explain the conflict and the choices | Someone else edited this page. Review their changes or keep yours. |
Notice that the system error reassures the user about their work. When data is at stake, the first thing a user wants to know is "Did I lose anything?" Answer that before anything else.
Place the message where the problem is
Placement is part of the copy. The same words work or fail depending on where they appear.
- Inline errors appear next to the field. Use them for validation. The user sees the problem and the input together.
- Summary errors appear at the top of a form and list every problem, each linking to its field. Use them when a form has several errors, so the user does not have to scroll to find them.
- Banners and toasts suit page-level or system problems. Avoid toasts for errors that need action, because they disappear on a timer.
- Dialogs interrupt the user. Reserve them for errors that block everything until resolved.
Never rely on color alone, and never show a red border with no text. The message must exist as words.
Make errors accessible
Sighted users see a red message appear. Screen reader users hear nothing unless you connect the message to the field and announce it. The plan's HTML example does this:
<label for="email">Email address</label>
<p id="email-hint">We'll send your receipt here.</p>
<input id="email" name="email" type="email" autocomplete="email"
aria-describedby="email-hint email-error" aria-invalid="true">
<p id="email-error">Enter an email address like [email protected].</p>Three things happen here. The label stays visible and tied to the input. The aria-describedby attribute links both the hint and the error to the field, so a screen reader reads them with it. The aria-invalid="true" attribute tells assistive technology that the current value is wrong.
Two cautions apply. First, add aria-invalid="true" and the error text only when the field actually has an error, not on page load. Second, if an error appears after the user submits, move focus to the first invalid field or to the error summary. Otherwise a keyboard or screen reader user may not know anything changed.
Tone for errors
Error moments need a calm, steady version of your product voice. The voice stays the same. The tone adjusts.
- Be direct and neutral. Skip exclamation marks.
- Take responsibility when the system is at fault: "We couldn't save your changes." Avoid "Oops!" because it minimizes real loss.
- Do not over-apologize. One "Sorry" is enough for a serious failure. A typo in a field does not need an apology at all.
- Use "we" for the product and "you" for the user, without shifting blame.
Compare two rewrites of a failed payment:
Weak: Payment failed. Invalid card.
Better: We couldn't charge your card. Check the card number and expiry date, or try a different card.The better version names the action that failed, lists the likely fixes, and offers an alternative.
Prevent errors before writing them
The best error message is one nobody sees. Before writing error copy, check whether other copy can prevent the error.
- Show the expected format in a hint: "Use the format DD/MM/YYYY."
- State rules before the user types: "Password must be at least 8 characters."
- Accept reasonable variations, such as phone numbers with or without spaces, instead of rejecting them.
- Validate when the user leaves a field, not on every keystroke. Showing "Invalid email" after the first typed letter is noise.
A recovery flow, step by step
The diagram shows how the pieces fit when a user submits a form with a problem.
Each step has a copy responsibility. The inline error names the fix. The summary lets the user see everything at once. The success confirmation closes the loop.
Common mistakes and edge cases
- Messages that repeat the label. "Email: invalid email" adds nothing. Say what to do.
- One message for several causes. "Login failed" hides whether the password is wrong or the account is locked. For security, you may need to stay general ("Email or password is incorrect"), but when you can be specific without exposing account details, be specific.
- Errors that vanish. If a message disappears before the user reads it, they cannot recover. Keep error messages on screen until the problem is resolved.
- Dead ends. A message with no action traps the user. Always provide a retry, a link to help, or a way to contact support.
- Raw server text. If an API returns a message, do not display it directly. Map each error code to written copy and keep a generic fallback for unknown errors.
- Dynamic values breaking grammar. If you insert a field name or number, check that the sentence still reads well for every value. This also matters for translation, which a later chapter covers.
Quick checklist
Before shipping an error message, check that it:
- Says what is wrong in plain words.
- Tells the user what to do next.
- Avoids codes, jargon, and blame.
- Sits next to the problem and stays until it is fixed.
- Is linked to the field for assistive technology.
- Uses a calm tone that suits the severity.
- Reassures the user when their data is safe, or says clearly when it is not.
Exercise
A user uploads a 25 MB image to a form that accepts files up to 10 MB. The current message is "Error 413: Payload too large." Rewrite it as an inline error message, and say which part of the three-part structure (what happened, why, what now) each part of your rewrite covers.
Show answer
Example: "This image is too large. Choose a file smaller than 10 MB." "This image is too large" covers what happened. The 10 MB limit explains why and the "Choose a file smaller than 10 MB" sentence covers what now. You could also add "or compress it first" as an extra action. The rewrite drops the code, names the object (the image), and gives a concrete limit.
Exercise
A signup form shows a red border on the password field and no text. Name two problems with this for users, and describe the fix, including one accessibility attribute you would use.
Show answer
Problem 1: the error depends on color alone, so users with color blindness or low vision may miss it, and it tells nobody what is wrong. Problem 2: a screen reader announces nothing about the error. Fix: add visible text such as "Enter a password with at least 8 characters," place it next to the field, link it to the input with aria-describedby, and set aria-invalid="true" on the input when the value is wrong.
Exercise
Your product shows "Oops! Something went wrong." when a document fails to save. Rewrite it for a system error, and include reassurance about the user's work.
Show answer
Example: "We couldn't save your changes. Your draft is still open on this page. Check your connection and select Try again." It names the failed action, answers whether work is lost, avoids "Oops!", and gives a next step with a button label that names the action.