PhraseryPhrasery homeGet Phrasery
Code review & debugging21 categories

Improve these error messages

Errors that say "something went wrong".

Mediumerrorsux
Rewrite the error messages in this code so they help whoever hits them.

Every message should answer:
1. What was being attempted
2. What went wrong specifically
3. What the reader can do about it

Distinguish messages meant for developers (include identifiers, values, context) from messages meant for users (no stack traces, no internals, plain language, a clear next step).

Flag any error that is silently swallowed, and any catch block that loses the original cause.

Code:

Making it yours

  • Paste your own material where the prompt asks for it. Everything above that line is instruction, not content.
  • Delete any rule that does not apply to you. A shorter prompt that fits beats a thorough one that does not.
  • If the answer comes back vague, add a line saying what you do not want. Constraints work better than encouragement.

Refactoring and design calls. Cutting code down, naming things properly, and choosing between two workable options.

Related prompts

Keep this one

Phrasery saves prompts with a right-click and puts them back the same way. Add this to your own library in one click.

Add to your browser โ€” free