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.
High because unhelpful errors drive support load, abandonment, and block every downstream task until the user figures it out.
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)
}
ID: cli-quality.error-handling.error-messages
Severity: high
What to look for: Count all error handling paths. For each error, examine error messages in catch blocks and error handlers. Good error messages have three parts: (1) what went wrong, (2) why it matters or what caused it, and (3) how to fix it or what to try next. Check for raw exception messages passed directly to the user (e.g., ENOENT: no such file or directory without context). Check for errors that only say "Error" or "Something went wrong" with no detail.
Pass criteria: Error messages describe the specific problem in user-facing language and include a suggestion for resolution. Raw system error codes (ENOENT, ECONNREFUSED) are translated to human-readable messages. Errors include the relevant context (which file, which command, which argument) — 100% of error messages must include what went wrong and at least 1 suggested fix. Report: "X error paths found, all Y produce actionable error messages."
Fail criteria: Raw exception messages or system error codes shown to users without context, or generic "Error occurred" messages with no specifics, or error messages that don't suggest what to do next.
Skip (N/A) when: All checks skip when no CLI entry point is detected.
Detail on fail: "ENOENT errors bubble up as raw Node.js messages — user sees 'Error: ENOENT: no such file or directory, open config.json' instead of 'Configuration file not found: config.json. Run mytool init to create one.'" or "Network errors show raw 'fetch failed' with no suggestion to check connectivity"
Remediation: Good error messages save users from searching Stack Overflow:
// Before (unhelpful):
catch (err) {
console.error(err.message) // "ENOENT: no such file or directory, open '/home/user/.mytoolrc'"
}
// After (helpful):
catch (err) {
if (err.code === 'ENOENT') {
console.error(`Configuration file not found: ${err.path}`)
console.error('Run `mytool init` to create a default configuration.')
} else if (err.code === 'ECONNREFUSED') {
console.error(`Cannot connect to server at ${url}`)
console.error('Check that the server is running and the URL is correct.')
} else {
console.error(`Unexpected error: ${err.message}`)
}
}