ChoiceSoftware deliveryCommunity

Error message helpfulness

Review one error message before it ships and decide whether it helps people recover, is too vague to act on, leaks internal details such as stack traces or SQL, or blames and confuses the reader, so product and engineering teams release clear, safe errors.

F@f

Limits to keep in mind

The classifier sees one message without the full screen or product flow; placement, timing and visual design also affect clarity.

It cannot verify that the stated cause is technically correct; a confident but wrong message still needs a developer to check it.

Localization can change tone and length; review translated messages separately.

Problem

Error messages are often written last, by the developer who knows the system best, and end up as 'Something went wrong', raw exception text, internal error codes or wording that blames the user. Vague errors flood support, leaked stack traces and queries expose internals to attackers, and confusing messages make people give up. Reviewing every string by hand in code review is easy to skip.

Goal

Label each error message for its audience so clear, actionable messages ship as they are, vague ones get a cause and a next step, messages that expose internal details are fixed before release, blaming or jargon-heavy ones are rewritten in plain neutral words, and a person decides when the context is unclear.

Input / state

One error message as shown to its reader, who the reader is, where and when it appears, and any product writing rules.

error_message
The exact error text the reader sees, including any title, code or button labels.
audience
Who reads it: end users in an app or website, developers calling an API, or operators reading logs or an admin console.
context
Where the message appears and what the reader was doing, for example submitting a payment form or calling an endpoint.
style_rules
Optional: the team's writing or security rules for errors, such as tone, required error codes or what must never be shown.

Decision question

ChoiceQuestion key error_message_quality

Does this message help its audience understand and recover? Use helpful when it says what happened and what to do next in words the audience understands. Use vague when the cause or the next step is missing. Use leaks_internals when it exposes stack traces, queries, file paths, hostnames, secrets or internal ids to readers who should not see them. Use blaming_or_confusing when it blames the reader, uses jargon or bare codes for the audience, or misleads. Use needs_review when unsure.

Options

  • helpfulSays what went wrong, why if known, and what the reader can do next (retry, fix a field, contact support with a reference), in plain words suited to the audience. For API readers it may include a stable error code and a documentation link.
  • vagueGives no usable cause or next step, such as 'Something went wrong', 'Error occurred' or 'Invalid request' with nothing else, so the reader cannot recover or explain the problem to support.
  • leaks_internalsShows internal details to a reader who should not see them: stack traces, exception class names, SQL queries, file paths, server names, internal ids, tokens or configuration values. Detailed internals in operator-only logs are not a leak.
  • blaming_or_confusingBlames or scolds the reader ('You entered an illegal value'), uses technical jargon or bare codes for non-technical readers, is misleading about the cause, or gives instructions the reader cannot follow.

Allowed outcomes

Decided in your code from the answer and its confidence. Thresholds are yours to set and test.

  • Ask a writer or security reviewerThe audience or context is unclear, the message mixes problems, it touches security or legal wording, or confidence is below your threshold.
  • Ship the messageThe message is clear, accurate and actionable for its audience and follows the style rules.
  • Add the cause and a next stepThe reader cannot tell what happened or what to do; add a short cause, a recovery step and, if useful, a support reference.
  • Remove internal details firstInternal details are visible to users or API callers; replace them with a safe message and log the details server-side with a reference id.
  • Rewrite in plain, neutral wordsThe tone blames the reader or the words do not fit the audience; rewrite neutrally, explain the problem in their terms and keep any code secondary.

Example scenarios

Predefined demonstrations. No model is called; the outcome shown is an illustrative judgment.

Example state

{
  "context": "Checkout page after pressing Pay",
  "audience": "End users in a web shop",
  "style_rules": "Friendly, no blame, say whether money was taken",
  "error_message": "Your card was declined by your bank. Please check the card details or try another payment method. Nothing was charged."
}

Outcome

Illustrative
Ship the message

The message is clear, accurate and actionable for its audience and follows the style rules.

Why

States what happened, reassures about the charge and gives two clear next steps.

Using it well

  • Judge the message for its stated audience: an exception name is normal in an operator log but a leak in a checkout page.
  • A helpful message usually answers three things: what happened, why if known, and what to do now.
  • Error codes are fine as an extra for support or API readers, but a code alone is not helpful for end users.
  • Security-sensitive flows like login and password reset may deliberately stay generic ('Email or password is incorrect'); that is helpful, not vague, when a next step is given.
  • Any stack trace, SQL, file path, hostname or token visible outside operator logs is leaks_internals, even if the rest of the message is good.
  • Words like 'illegal', 'invalid user', 'you failed' or 'bad input' point to blaming_or_confusing.
  • When one message is both vague and leaking, choose leaks_internals because it must be fixed first.

Request definition

POST https://api.typesafe.ai/v1/systemone
{
  "model": "jev-latest",
  "state": {
    "error_message": "<error_message>",
    "audience": "<audience>",
    "context": "<context>",
    "style_rules": "<style_rules>"
  },
  "questions": {
    "error_message_quality": {
      "type": "choice",
      "instructions": "Does this message help its audience understand and recover? Use helpful when it says what happened and what to do next in words the audience understands. Use vague when the cause or the next step is missing. Use leaks_internals when it exposes stack traces, queries, file paths, hostnames, secrets or internal ids to readers who should not see them. Use blaming_or_confusing when it blames the reader, uses jargon or bare codes for the audience, or misleads. Use needs_review when unsure.",
      "criteria": {
        "helpful": "Says what went wrong, why if known, and what the reader can do next (retry, fix a field, contact support with a reference), in plain words suited to the audience. For API readers it may include a stable error code and a documentation link.",
        "vague": "Gives no usable cause or next step, such as 'Something went wrong', 'Error occurred' or 'Invalid request' with nothing else, so the reader cannot recover or explain the problem to support.",
        "leaks_internals": "Shows internal details to a reader who should not see them: stack traces, exception class names, SQL queries, file paths, server names, internal ids, tokens or configuration values. Detailed internals in operator-only logs are not a leak.",
        "blaming_or_confusing": "Blames or scolds the reader ('You entered an illegal value'), uses technical jargon or bare codes for non-technical readers, is misleading about the cause, or gives instructions the reader cannot follow."
      }
    }
  }
}

Request shape from the System One API reference; a Kev server accepts the same body. Replace the placeholder state with your data. Requests need your own API key or server.

Version History

v1Current Versionabout 1 hour ago@f

Initial version

Comments (0)