Write Failure Messages for an Internal Tool
Added 2026-11-06
An internal error message should let a colleague try one step alone.
These are the failure cases of an internal tool: [purpose, users, common failures]. Write the messages: 1) each states what happened, the likely cause, and the next action; 2) separate errors users can fix from those that need the maintainer; 3) include a copyable diagnostic command or log location; 4) flag which failures should be retried or auto-fixed instead of shown; 5) set a length limit and a tone that does not blame the user; 6) list the internal jargon to replace with plain words.
Site original
Chinese original
Replace these placeholders 1
Swap the bracketed parts for your own details before sending.
[purpose, users, common failures]
How to use
Assume the user will read two lines at most.
Try tweaking it
- Have it restate requirements and constraints before writing code.
- Ask for the smallest change plus a rollback path, not a full-file rewrite.
What you should get
- A minimal, runnable change with copy-ready code
- Impact list: which files and call sites must follow
Common mistakes
- Asking it to touch ten files at once, then losing track of what broke what.
- Pasting only the error, with no code or version, and getting an unfixable answer.
How to check the output
- The change runs, can be rolled back, and touches nothing unrelated.
- Edge cases (empty, oversized, concurrent) are covered or explained.
Where it works
- Good for: having it restate requirements and constraints, then propose the smallest runnable change.
- Watch out: include versions and a minimal reproduction with the error, or the fix may look plausible but not fit.