From 7fc7c2452b4256fe7302b6f7b6bb83c8ebb305da Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sat, 20 Jan 2024 22:57:44 +0100 Subject: lazy error handling in the client --- client/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'client') diff --git a/client/src/lib.rs b/client/src/lib.rs index e751958..19be760 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -140,7 +140,7 @@ impl Session { } pub async fn download_url(&self, mut writer: impl UnpinWrite, url: String) -> Result<()> { - let mut r = self.client.get(url).send().await?; + let mut r = self.client.get(url).send().await?.error_for_status()?; while let Some(chunk) = r.chunk().await? { writer.write_all(&chunk).await?; } -- cgit v1.2.3-70-g09d2