Why it matters

Bad error messages generate support tickets. Good ones self-serve. Investment pays back in reduced support and better UX.

Advertisement

The architecture

Structure: what went wrong (identify), why (context), how to fix (action).

Level: match audience. End users see friendly; developers see technical.

Error message structureWhat happenedidentify problemWhycontextActionwhat to tryInclude correlation ID for support; makes debugging much faster
Error message parts.
Advertisement

How it works end to end

Be specific: 'invalid email format' beats 'invalid input'.

Suggest fix: 'please enter address like user@example.com'.

Include correlation ID: 'reference ID: abc123' enables support to find the issue.

Machine-readable for APIs: error code + message. Enables clients to react programmatically.