fix(config): replace panics in parse_proxy_config with proper Result errors

parse_proxy_config was using expect()/unwrap()/panic!() which would
crash the process on malformed proxy config strings instead of
returning a descriptive error. Now returns ConfigError::ProxyConfigInvalid
with the specific issue (bad scheme, bad address). Added tests for
invalid scheme, invalid address, and end-to-end from_serve_options.
This commit is contained in:
2026-06-08 05:30:23 +00:00
parent 68728451a4
commit b0a885ea40
3 changed files with 101 additions and 28 deletions

View File

@@ -1,7 +1,7 @@
---
id: cleanup/panic-free-static-config
name: Replace panic/expect/unwrap with Result-based error handling in StaticConfig
status: pending
status: completed
depends_on:
- review/phase1-core-modifications
scope: narrow
@@ -40,4 +40,4 @@ Since `StaticConfig::from_serve_options()` already returns `Result<..., ConfigEr
## Summary
> To be filled on completion
> Replaced all panic!/expect()/unwrap() in parse_proxy_config with Result-based error handling. Added ConfigError::ProxyConfigInvalid variant. Invalid proxy scheme or malformed address now returns clear errors instead of panicking. Added 4 new tests covering invalid scheme, invalid address, and from_serve_options error propagation.