From cf8d664349c724766f008d83610be77d1f9b4717 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leon=20Gr=C3=BCnewald?= <10533763+dhalucario@users.noreply.github.com> Date: Sat, 2 Aug 2025 16:16:17 +0200 Subject: [PATCH] Add error_for_status_ref for functions --- r621/src/client.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/r621/src/client.rs b/r621/src/client.rs index af45dfd..fc134f7 100644 --- a/r621/src/client.rs +++ b/r621/src/client.rs @@ -78,6 +78,7 @@ impl Client { ) -> Result> { self.request_limiter().await; let res = self.list_posts_raw(limit, tags, page).await?; + res.error_for_status_ref()?; Ok(res.json::().await?.into()) } @@ -101,6 +102,7 @@ impl Client { pub async fn get_post(&mut self, post_id: Id) -> Result { self.request_limiter().await; let res = self.get_post_raw(post_id).await?; + res.error_for_status_ref()?; Ok(res.json::().await?.into()) }