From 8414da3e0c7736167e0a3f511c417a5b948d60aa Mon Sep 17 00:00:00 2001 From: peyton Date: Sun, 23 Nov 2025 02:29:51 -0500 Subject: [PATCH] Fix: Add HTTP status code error handling to prevent download hangs When download requests receive HTTP error responses (like 429, 503, etc.), the code was previously waiting indefinitely for chunks that would never arrive. This adds response.error_for_status_ref()? to immediately fail with a clear error message when the server returns an error status code. Fixes issue where modpack downloads would hang at 0 B/s indefinitely. --- libium/src/upgrade/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/libium/src/upgrade/mod.rs b/libium/src/upgrade/mod.rs index dd39939..7b5609d 100644 --- a/libium/src/upgrade/mod.rs +++ b/libium/src/upgrade/mod.rs @@ -284,6 +284,7 @@ impl DownloadData { ); let mut response = client.get(url).send().await?; + response.error_for_status_ref()?; while let Some(chunk) = response.chunk().await? { temp_file.write_all(&chunk)?;