Create reusable error handling helpers to reduce boilerplate and
enforce consistency across the codebase:
- FatalError(format, args...): writes "Error: ..." to stderr and exits
- FatalErrorWithHint(message, hint): includes actionable suggestion
- WarnError(format, args...): writes "Warning: ..." to stderr
Prototyped in create.go to validate the approach - converted 13 error
patterns and 5 warning patterns. This reduces code from:
fmt.Fprintf(os.Stderr, "Error: %v\n", err)
os.Exit(1)
To simply:
FatalError("%v", err)
Also fixed countIssuesInJSONLFile reference after earlier refactoring.
See docs/ERROR_HANDLING.md for the three-pattern guideline.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
66 KiB
66 KiB