-
Notifications
You must be signed in to change notification settings - Fork 46
Description
Description
Apply console.FormatErrorMessage() formatting to the top 5 CLI files with highest unformatted error counts (388 total errors, representing 25% of all unformatted errors in the codebase). Currently only 4.4% (69/1,581) of error output sites use proper console formatting.
Problem
Users see raw Go error messages instead of helpful, formatted guidance. The top 5 CLI files alone contain 388 unformatted errors, creating inconsistent error presentation across user-facing commands.
Suggested Changes
Files to Update (Priority Order)
pkg/cli/add_interactive.go- 107 unformatted errorspkg/cli/init.go- 100 unformatted errorspkg/cli/add_command.go- 72 unformatted errorspkg/cli/audit_report_render.go- 61 unformatted errorspkg/cli/trial_command.go- 48 unformatted errors
Pattern to Replace
// ❌ BEFORE - Raw error output
if err != nil {
fmt.Fprintln(os.Stderr, err)
return err
}
// ✅ AFTER - Console formatted error
if err != nil {
fmt.Fprintln(os.Stderr, console.FormatErrorMessage(err.Error()))
return err
}Also Fix stdout Anti-patterns
// ❌ BEFORE - Error to stdout
if err != nil {
fmt.Println(err)
return err
}
// ✅ AFTER - Error to stderr with formatting
if err != nil {
fmt.Fprintln(os.Stderr, console.FormatErrorMessage(err.Error()))
return err
}Success Criteria
- Update all error outputs in
add_interactive.go(107 errors) - Update all error outputs in
init.go(100 errors) - Update all error outputs in
add_command.go(72 errors) - Update all error outputs in
audit_report_render.go(61 errors) - Update all error outputs in
trial_command.go(48 errors) - All
fmt.Fprintln(os.Stderr, err)→fmt.Fprintln(os.Stderr, console.FormatErrorMessage(err.Error())) - Verify no stdout error outputs remain
- Test commands manually to verify formatting
Manual Testing
# Test each command with intentional errors
./gh-aw init /nonexistent/path
./gh-aw add /invalid/workflow.md
./gh-aw trial nonexistent-workflow
./gh-aw audit 99999999
# Verify errors are colored/formatted in terminalImpact
388 errors (25% of all unformatted errors) will have proper console formatting, providing maximum user-facing impact.
Source
Extracted from Error Experience Engineering Discussion #12265
Priority
High - Direct user experience improvement
Estimated Effort
Large (1 week)
AI generated by Discussion Task Miner - Code Quality Improvement Agent
- expires on Feb 18, 2026, 9:08 PM UTC