Error messages explain the problem and suggest a fix
Why it matters
Error: ENOENT: no such file or directory, open '/home/user/.mytoolrc' tells the user nothing they can act on. They Google the error code, land on Stack Overflow, waste thirty minutes. Configuration file not found: ~/.mytoolrc. Run \mytool init` to create one.` solves the problem in one line. Raw exception messages are a signal the tool was built without thinking about the user's experience on the failure path — which is, for most users, the majority of their interaction with the tool.
Severity rationale
High because unhelpful errors drive support load, abandonment, and block every downstream task until the user figures it out.
Remediation
Wrap top-level error handling in src/cli/lib/errors.ts and translate system codes (ENOENT, ECONNREFUSED, EACCES) into human messages that name the resource and suggest a next step:
if (err.code === 'ENOENT') {
console.error(`Config not found: ${err.path}`)
console.error('Run `mytool init` to create one.')
process.exit(1)
}
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the CLI Quality Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
Taxons
History
- 2026-04-18·v1.0.0·Initial import from cli-quality·automated