diff --git a/crates/uv/src/commands/reporters.rs b/crates/uv/src/commands/reporters.rs index cf4ac89b1..6ad15010a 100644 --- a/crates/uv/src/commands/reporters.rs +++ b/crates/uv/src/commands/reporters.rs @@ -297,7 +297,13 @@ impl ProgressReporter { return; }; - state.lock().unwrap().bars[&id].inc(bytes); + // Avoid panics due to reads on failed requests. + // https://github.com/astral-sh/uv/issues/17090 + // TODO(konsti): Add a debug assert once https://github.com/seanmonstar/reqwest/issues/2884 + // is fixed + if let Some(bar) = state.lock().unwrap().bars.get(&id) { + bar.inc(bytes); + } } fn on_request_complete(&self, direction: Direction, id: usize) {