Skip to content

fix: clean up error messages in main#5

Merged
ogrman merged 1 commit intomasterfrom
fix/clean-up-error-messages
Jan 6, 2026
Merged

fix: clean up error messages in main#5
ogrman merged 1 commit intomasterfrom
fix/clean-up-error-messages

Conversation

@ogrman
Copy link
Owner

@ogrman ogrman commented Jan 6, 2026

Summary

  • Refactors main() to separate error handling from the core run() function
  • Prints errors with lowercase "error:" prefix following standard CLI conventions
  • Uses indented "caused by:" for error chains instead of the raw anyhow format
  • Includes config file path in error messages for easier debugging

Before:

Error: Reading the config file

Caused by:
    No such file or directory (os error 2)

After:

error: failed to read config file 'nonexistent.yaml'
  caused by: No such file or directory (os error 2)

Test plan

  • cargo test passes
  • Verified error output with missing config file
  • Verified error output with invalid YAML

🤖 Generated with Claude Code

- Separate run() function from main() for better error handling
- Print errors with lowercase "error:" prefix like standard CLI tools
- Use indented "caused by:" for error chain instead of "Caused by:"
- Include config file path in error messages for easier debugging

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@ogrman ogrman force-pushed the fix/clean-up-error-messages branch from 77bfa55 to 796a8e8 Compare January 6, 2026 21:44
@ogrman ogrman merged commit 0d96245 into master Jan 6, 2026
1 check passed
@ogrman ogrman deleted the fix/clean-up-error-messages branch January 6, 2026 21:45
@ogrman ogrman mentioned this pull request Jan 6, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant