conditionally raise error

This commit is contained in:
Nexus 2024-04-14 19:52:18 +01:00
parent 8d5744c23d
commit 74b3385051
Signed by: nex
GPG key ID: 0FA334385D0B689F

View file

@ -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: