Customers & growth · Developer marketing

Error message framework

CLEARACTIONABLEDOCUMENTEDHELPFUL

Use it when

Developers hit errors from your API, CLI or SDK and cannot tell what went wrong or how to fix it, and you need one standard for every error message.

Skip it when

  • You do not yet know which stage of the developer journey loses people. Use Developer experience (DX) framework to rate every stage first.
  • You are designing a whole API, including resources, methods and versions. Use API design principles, which sets the error format as one of its rules.
  • The errors appear in forms or checkout flows for customers who do not write code. Use Error prevention & recovery.
  • The wording is right but tone for upset readers is off across the product. Use Tone adaptation framework.
  • You need to audit the docs pages that explain each error. Use Documentation quality framework, which this framework feeds.

What to apply first and what to use instead are listed below.

Inputs

  • Error inventory
    Every error the API, CLI or SDK can return, with its code, status and current message, from the code base, API description and logs.
  • Error frequency
    How often each error was returned in the last 30 days, from gateway or application logs.
  • Support evidence
    Tickets, forum threads and community questions that quote an error in the last 90 days, from the help desk and community channels.
  • Error format
    The response format every error will use, such as problem details for HTTP APIs (RFC 9457) or your existing house format, from the API team.
  • Reader profile
    Who reads the messages and how much they know about the product, from the developer journey map.

Steps

  1. List every error with its code, status, current message and 30-day count, and rank the list by count and by tickets that quote each error.
  2. Rewrite each message so it names the specific cause and the input value that caused it, states the rule it broke, and tells the developer what to change.
  3. Give each error a stable code and return it in one format, with a type link that opens the docs page for that error, a short title that never changes and a detail line for this occurrence.
  4. Strip stack traces and internal names from responses and log them on the server against the code. Replace any catch-all message that hides a known cause with that cause.
  5. Check the wording for plain terms used the same way everywhere, no blame, no jokes and no apology filler.
  6. Ask a developer new to the product to fix each of the most frequent errors using only the message and its linked page, and log every error they could not fix.

Output

An error catalog with one row per error, ready to go into the API description and the docs.

  • Error code
  • Status or exit code
  • Title
  • Message (cause, input value, fix)
  • Docs link
  • 30-day count
  • Tickets quoting it
  • Review result

Done when

  • Every error the product can return has a row with a unique code.
  • Every message names the cause and a change the developer can make.
  • Every error caused by an input names the value received.
  • No error response exposes a stack trace, file path or internal service name.
  • Every code links to a docs page that exists, and the reviewer fixed each of the most frequent errors from the message and that page alone.

Measure

For 30 to 60 days before and after release, track support tickets that quote each error and how often the same account hits the same error again within a session. Compare each code with its own baseline. The rewrite worked when tickets and repeat errors for the rewritten codes fall while total call volume holds steady.

Hypothetical example

Ledgerly, a payments API, finds that one generic "invalid request" error was returned 12,000 times in 30 days and quoted in 85 tickets. Most cases come from sending amounts as decimals. The team splits it into three codes. The amount error now names the field, shows the value received as 12.50 and says to send whole cents, such as 1250. Each code links to its own docs page, and stack traces move to server logs. A new developer fixes all ten top errors from the messages alone. Over the next 45 days, tickets quoting amount errors fall from 85 to 19.

Common mistakes

  • Returning one generic message for many failures. Give each known cause its own code and message.
  • Putting stack traces or internal names in responses to help debugging. Log them on the server against the code and return only what the developer can act on.
  • Describing the cause with no fix. End each message with what to change.
  • Changing a code or title after release. Keep both stable, since client code and docs depend on them, and add new codes for new causes.
  • Letting messages and docs drift apart. Link each code to its docs page and check every link at each release.

Sources

By company stage

  1. Pre-IdeaNot applicableThere is no product yet, so there are no error messages to design.
  2. IdeaUsefulA first prototype benefits from clear errors, but speed to first customers matters more.
  3. Early StartupUsefulClear errors reduce support load and onboarding friction while the team tunes the product.
  4. StartupUsefulGrowing user numbers make better errors and docs a steady way to cut support tickets.
  5. GrowthUsefulDeveloper experience at scale benefits from consistent, documented error standards across teams.
  6. ScaleUsefulMultiple products need shared error conventions, which adds value without blocking progress.
  7. EnterpriseUsefulPlatform and product teams still maintain error standards across many products as routine work.

Apply first

Nothing. You can start here.

Use instead

  • Developer experience (DX) framework

    You do not yet know which stage of the developer journey loses people. Use Developer experience (DX) framework to rate every stage first.

  • API design principles

    You are designing a whole API, including resources, methods and versions. Use API design principles, which sets the error format as one of its rules.

  • Error prevention & recovery

    The errors appear in forms or checkout flows for customers who do not write code. Use Error prevention & recovery.

  • Tone adaptation framework

    The wording is right but tone for upset readers is off across the product. Use Tone adaptation framework.

  • Documentation quality framework

    You need to audit the docs pages that explain each error. Use Documentation quality framework, which this framework feeds.

Recommended resources

No sponsored resources on this framework yet. Sponsored listings would be labelled here, never in search.

Progress is not saved until you have an account. Create a free account