From 2c9baa16df3579bd1c19064435f002a3c12b24f3 Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Wed, 27 Nov 2024 18:39:25 +0400 Subject: [PATCH] fix: return immediately on non-200 --- src/main.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.rs b/src/main.rs index 3208575..da980b8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -94,6 +94,7 @@ async fn handler(cfg: &Config, s: &mut State) -> Result<(), reqwest::Error> { ]) .send() .await? + .error_for_status()? .json::() .await? .result; @@ -112,6 +113,7 @@ async fn handler(cfg: &Config, s: &mut State) -> Result<(), reqwest::Error> { { let mut args = text.split_whitespace(); args.next(); // skip command name + match args.next()? { "ru" => { let comic_id = args.next()?.parse::().ok()?;