Repository navigation
Web HIG tip #7: Errors should say what failed and how to fix it #16
frozonfreak
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
"Something went wrong" tells people that something broke. It doesn't tell them what broke or what to do next.
Web HIG tip #7 (Quick #34 / HIG-ERR-001, and Quick #57): Error states must say what failed, why (when known), and how to recover. Error messages must be specific and actionable, not "Invalid input."
Why it matters
Vague errors push the work back onto the user:
The rule of thumb
Ask: after reading this error, does the user know what to do next?
If not, rewrite it.
Linking the message with
aria-describedbyis the same pattern from tip #4 (Quick #80). The new part here is the wording. On long forms, also list the errors in a summary at the top (Quick #51).For an email field, "Enter an email address like name@example.com" beats "Invalid email." For a failed save, "We couldn't save your changes because the connection dropped. Your edits are still here. Try again." beats "Error 500."
Do this instead
Quick check for your app
Trigger three errors on purpose: one invalid field, one failed save, and one expired session. For each, read only the message. Can you tell what failed and what to do next without guessing? If any message just says "Invalid," "Error," or "Something went wrong," rewrite it.
The Web HIG is a behavioral contract for how the web should behave, not a component library. Design systems define how it looks. The Web HIG defines how it behaves.
All reactions