From 74b3385051e797f32d8d0db6f0847dbd10691c1f Mon Sep 17 00:00:00 2001 From: nexy7574 Date: Sun, 14 Apr 2024 19:52:18 +0100 Subject: [PATCH] conditionally raise error --- cogs/other.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cogs/other.py b/cogs/other.py index d426780..bdeb1a1 100644 --- a/cogs/other.py +++ b/cogs/other.py @@ -551,7 +551,8 @@ class OtherCog(commands.Cog): }, follow_redirects=False ) - response.raise_for_status() + if response.status_code not in range(200, 400): + response.raise_for_status() except httpx.HTTPError as e: raise RuntimeError(f"Failed to upload OCR content: `{e}`") else: