Commit Graph

2 Commits

Author SHA1 Message Date
Daniel Sauer
8332a719ab fix(errors): use errors.As for wrapped error handling (#462)
IsSilentExit used type assertion which fails on wrapped errors.
Changed to errors.As to properly unwrap and detect SilentExitError.

Added test to verify wrapped error detection works.
2026-01-16 11:05:59 -08:00
Steve Yegge
637f38edca Remove os.Exit() from library code (gt-fm75)
Refactor to return errors instead of calling os.Exit() directly:
- Add SilentExitError type for commands that signal status via exit code
- Update mail.go runMailPeek() and runMailCheck() to return errors
- Change Execute() to return int exit code instead of calling os.Exit()
- Move os.Exit() call to main() where it belongs

This improves testability, enables graceful shutdown, and follows Go
conventions for library code.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 10:54:29 -08:00