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

This commit is contained in:
Adil Hafeez 2026-03-31 14:28:11 -07:00 committed by GitHub
parent 36fa42b364
commit d8f4fd76e3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 9 additions and 4 deletions

View file

@ -75,7 +75,10 @@ pub trait Client: Context {
fn add_call_context(&self, id: u32, call_context: Self::CallContext) {
let callouts = self.callouts();
if callouts.borrow_mut().insert(id, call_context).is_some() {
panic!("Duplicate http call with id={}", id);
log::warn!(
"Duplicate http call with id={}, previous context overwritten",
id
);
}
self.active_http_calls().increment(1);
}