Skip to content

replace production panics with graceful error handling in common crate#844

Open
adilhafeez wants to merge 1 commit intomainfrom
adil/fix-production-panics-common-crate
Open

replace production panics with graceful error handling in common crate#844
adilhafeez wants to merge 1 commit intomainfrom
adil/fix-production-panics-common-crate

Conversation

@adilhafeez
Copy link
Copy Markdown
Contributor

Summary

  • open_ai.rs: Replace panic!("Unsupported content type") in Display impl with silently skipping unknown content types (same as ImageUrl handling) — prevents crash when logging messages with new content types
  • ratelimit.rs: Replace panic!("repeated selector") with log::error! and skip the duplicate — prevents crash on config typo with duplicate rate limit selectors
  • http.rs: Replace panic!("Duplicate http call") with log::warn! — prevents crash if proxy-wasm runtime generates a duplicate call token ID

Also removes unused core::{panic, str} import that became dead code after the fix.

Test plan

  • cargo test --lib -p common — all 36 tests pass
  • cargo clippy --locked --all-targets --all-features -- -D warnings — clean
  • cargo fmt --all -- --check — clean

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