16 / 18

Principle 16

An error says how to go on

An error message has one job: to get the person moving again. It says what happened in plain words, next to where it happened, and what to do now.

In a real interface

✕ Avoid

✓ Do

Use numbers only, like 7600. The O looks like a zero.

01

Why

NN/g lists the guidelines: show the message close to the source of the error, use language familiar to the people using it, avoid blame and offer potential remedies.

WCAG 3.3.3 makes the last one a requirement at level AA: when the system detects an input error and knows how to fix it, the suggestion has to be shown.

02

How to apply it

Write the fix, not just the fault. Vercel's guidelines give the example: instead of Invalid API key, say the key is incorrect or expired and where to generate a new one.

Place the message by the field or the action that failed and keep what the person already typed, so they edit instead of starting over.

03

Edge cases

Some failures have no fix on the user side, like an outage. Then say so and say what will happen next. Error codes can stay for support, out of the main sentence.

✓ Do

  • Say what happened in plain words
  • Say what to do next
  • Show it next to the problem
  • Keep what was already typed

✕ Avoid

  • Show only a code
  • Blame the person
  • Clear the form after an error
  • Hide the message in a toast far from the field

For agents · PRINCIPLE.md

## An error says how to go on

 

- Say what happened in plain words and what to do next.

- Show the message next to the field or action that failed.

- Keep what the person already typed.

- Never blame the person; keep error codes out of the main sentence.

Enforced bytypebien errors say what happened and what to doBADESIGN designed loading, empty and error states