Error Message Anatomy
You'll learn: How to structure error messages so users immediately understand what happened, why it matters, and what to do about it.
The Three Essential Parts
Every effective error message is like a well-organized news story—it needs a clear structure. When something goes wrong in your application, users need three specific pieces of information:
1. What Went Wrong (The Problem)
This is the headline: a clear, jargon-free description of the error. Instead of "Authentication token expired," say "Your session has expired."
2. Why It Matters (The Impact)
Explain the consequence in user terms. "You'll need to log in again to continue" tells the user exactly what this error means for them, not for the system.
3. What to Do Next (The Action)
This is the most crucial part. Give users a clear path forward: "Click here to log in" or "Refresh the page to try again." Never leave them stranded with just a problem statement.
The Complete Picture
Think of error messages like driving directions. "Road closed" (what) is frustrating. "Road closed due to construction" (why) is informative. "Road closed due to construction—take Highway 5 instead" (action) is actually helpful.
Bad: "Error 403"
Better: "You don't have permission to view this page."
Best: "You don't have permission to view this page. Contact your administrator to request access, or return to the dashboard."
The anatomy doesn't have to be long—just complete. Each piece builds user confidence and reduces support requests.
Key Takeaway: Every error message should answer three questions: What happened? Why does it matter? What should I do? Missing any piece leaves users confused and frustrated.