Sub topic 9
Error Messages That Help Users Recover
Assume you know common interface elements such as forms, buttons, and dialogs, and have reviewed a web or mobile product before. This chapter focuses on the working model for useful error messages and the mistakes that prevent recovery.
An error message should help a person answer three questions:
- What went wrong?
- Where did it go wrong?
- What can I do now?
A useful message names the problem in the user’s terms, gives a next step, and keeps the person’s existing work whenever possible.
Replace diagnosis with a next step
Technical text describes what the system detected. Recovery text tells the user what to change.
| Weak message | Better message |
|---|---|
| Error 422: Invalid input in field | Enter an email address like [email protected]. |
| Authentication failed | The email or password is incorrect. Try again. |
| Request timed out | We could not save your changes. Check your connection and try again. |
Do not hide important details behind a code alone. An error code can help support staff, but it should not be the only explanation shown to the user.
Use this pattern:
- Identify the field or action.
- State the problem plainly.
- Give the expected format or next action.
- Say what happened to the user’s data when that matters.
For example, “Password must contain 12 characters, including a number” is more useful than “Password invalid.” It states the rule without blaming the person.
Put the message where the problem occurs
For a form field, place the message next to the field and connect it programmatically to that field. A summary at the top can help users find errors in a long form, but it should not replace the local message.
<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>The visible label identifies the field. The hint explains its purpose. The error explains how to recover. aria-describedby connects the supporting text for people using screen readers, and aria-invalid marks the field as invalid.
Do not rely on color alone. Use text, placement, and an appropriate visual indicator. Move focus to the first invalid field after a failed submission, unless doing so would disrupt a user’s current task.
Match the message to the failure
Client-side validation catches a problem before submission, such as a missing required value. Server-side errors occur after the product sends a request, such as a rejected payment or unavailable service. The recovery action differs, so the copy should differ too.
For a temporary failure, say what did not happen: “Your payment was not submitted.” Then offer a safe action: “Try again.” Avoid promising success when the system cannot guarantee it.
Review common errors
Check every message for these problems:
- It uses a technical code without a plain-language explanation.
- It says “invalid” without stating the expected value.
- It blames the user, such as “You entered the wrong information.”
- It disappears before the user can read or act on it.
- It uses idioms, abbreviations, or long strings that translate poorly.
- It gives different names to the same field or action.
Test messages with people completing the task. Record whether they found the error, understood the cause, corrected it, and completed the task. Keep successful patterns in the product’s style guide.
Exercise
Rewrite “File upload failed: error 413” for a user who selected a file that is too large.
Show answer
“This file is too large to upload. Choose a file smaller than 10 MB.”