Error Messages That Help: What Happened, and What To Do Now
An error message is the one piece of copy a person reads word by word. Most are written as a record of failure when they should be written as instructions for recovery.
Why this copy matters more than the rest
Almost everything written in an interface is skimmed. An error message is not. It is read carefully, because the person is stuck and that sentence is the only thing between them and what they came to do. It also arrives at the worst possible moment, when attention has already been spent and patience is short. That is reason enough to draft the failure cases before the smooth path rather than after it.
The conventions, and a long history of unhelpful examples, are collected in Wikipedia's article on error messages.
The three parts of a usable message
- What happened, in the words the person used, not the words the system uses internally.
- Why, when the reason is something they can act on. If the reason is internal, say that plainly instead of inventing a cause.
- What to do next, as one specific action rather than an invitation to try again.
As an illustration only, and not copy from any real product: "Error 0x80004005: invalid input" has none of the three. "That date is in the future — please check the year" has all three in one line.
Habits that make messages worse
- Blame. "You entered an invalid value" puts the fault on the reader. "This field needs a postcode" simply describes the gap.
- Codes without words. A reference number is useful for support and useless on its own. Give both.
- Apology instead of information. "Something went wrong, sorry!" tells the reader only that the product knows and will not say.
- One message for a whole form. A banner at the top saying "please correct the errors below" starts a search. Mark the fields.
- Messages that vanish. A toast that fades after three seconds is unreadable for anyone who looked away, and unrecoverable afterwards.
Prevent before you explain
The best error message is the one that never needs to appear. Constraining input so that a mistake is difficult to make is the idea behind poka-yoke, the mistake-proofing practice from manufacturing: shape the slot so the part only fits the right way round. In an interface that means date pickers that cannot produce an impossible date, fields that accept a card number with or without spaces, and amounts that validate as they are typed rather than on submission.
One caution: disabling a button until everything is valid, with no explanation of what is missing, converts an error message into a mystery. Prevention should narrow the possible mistakes, not hide the requirements.
Make the mistake cheap
Where a mistake cannot be prevented, it should be reversible. A reliable undo, described in Wikipedia's article on undo, does more for confidence than a carefully worded warning, because it lets people learn by trying instead of by reading. Confirmation dialogs are the weaker substitute: they interrupt everyone to catch the few, and they are dismissed reflexively after the third time.
The order of preference is simple. Prevent it. Failing that, allow it and let it be undone. Failing that, confirm it — and keep whatever was typed, so recovery does not mean starting again.
Placement and the things easily forgotten
- Put the message next to the control it concerns, and move keyboard focus there.
- If a long form has several problems, list them at the top and have each item move focus to its field.
- Never discard entered data because one field failed.
- Do not let colour be the only signal; pair it with text and an icon shape so it survives a monochrome screen or colour-blind vision.
- Keep the tone level. Humour in an error message reads as indifference to someone who has lost work.
A checklist before shipping
- Could this state have been prevented by constraining the input?
- Does the message name what happened without jargon?
- Does it give one next action?
- Is anything the person typed still there?
- Can it be read by someone who cannot see colour, and by a screen reader?
- Does it stay on screen until it has been dealt with?
How to find the bad ones
Deliberately fail every path. Submit the empty form, enter a letter where a number belongs, let a session expire, disconnect the network halfway. Write down each message as it appears, then read the list aloud in one sitting. The failures that sounded acceptable in isolation tend to sound evasive together.
The same discipline applies to the status and decline messages discussed in the note on deposit and withdrawal pages, and the reasoning about what belongs on screen is the one set out in the note on progressive disclosure: a fact that changes what someone should do next is never a detail.