diff options
author | metamuffin <metamuffin@disroot.org> | 2024-01-20 22:57:44 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-01-20 22:57:44 +0100 |
commit | 7fc7c2452b4256fe7302b6f7b6bb83c8ebb305da (patch) | |
tree | cd24640fe2dbabf3e380c4140ff9449938efc65b /client/src/lib.rs | |
parent | 0f74f013128f45a4f34761791203d88228a5eb52 (diff) | |
download | jellything-7fc7c2452b4256fe7302b6f7b6bb83c8ebb305da.tar jellything-7fc7c2452b4256fe7302b6f7b6bb83c8ebb305da.tar.bz2 jellything-7fc7c2452b4256fe7302b6f7b6bb83c8ebb305da.tar.zst |
lazy error handling in the client
Diffstat (limited to 'client/src/lib.rs')
-rw-r--r-- | client/src/lib.rs | 2 |
1 files changed, 1 insertions, 1 deletions
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?; } |