Skip to content

Replace panic!() with proper error handling#341

Open
zurawiki wants to merge 1 commit into
mainfrom
fix-error-handling
Open

Replace panic!() with proper error handling#341
zurawiki wants to merge 1 commit into
mainfrom
fix-error-handling

Conversation

@zurawiki

@zurawiki zurawiki commented Apr 4, 2026

Copy link
Copy Markdown
Owner

Why

get_llm_client used panic!() for config errors, producing ugly stack traces inside a git hook instead of clear error messages. Also fixes a pre-existing test failure where config key serialization of None values differs across platforms.

Stack: depends on #340

Test plan

  • Run cargo test — all 8 tests pass on all platforms (Linux, macOS, Windows)
  • Misconfigure the API key and run git commit — verify a clean error message instead of a panic stack trace

Base automatically changed from fix-llm-routing to main April 4, 2026 16:36
Change get_llm_client to return Result instead of panicking on config
errors. Users hitting missing API keys or bad config now get a clear
error message instead of a stack trace in their git hook.

Also fix config key test to be platform-independent — toml serialization
of None values differs across platforms.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@zurawiki zurawiki force-pushed the fix-error-handling branch from 6cc3911 to 6499a51 Compare April 4, 2026 17:00
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