Discord webhooks: Fix understood failing status codes
This commit is contained in:
@@ -52,6 +52,6 @@ def post_discord_webhook(username: Optional[str], content: str, is_queue: bool,
|
|||||||
json["embeds"] = [embed]
|
json["embeds"] = [embed]
|
||||||
|
|
||||||
res = requests.post(discord_url, json=json, headers={"Accept": "application/json"})
|
res = requests.post(discord_url, json=json, headers={"Accept": "application/json"})
|
||||||
if res.status_code != 200:
|
if not res.ok:
|
||||||
raise Exception(f"Failed to submit Discord webhook {res.json}")
|
raise Exception(f"Failed to submit Discord webhook {res.json}")
|
||||||
res.raise_for_status()
|
res.raise_for_status()
|
||||||
|
|||||||
Reference in New Issue
Block a user