From 2d877563ff2ba8219d5a005af5a9fb82909b68e5 Mon Sep 17 00:00:00 2001 From: Laurent Date: Fri, 21 Feb 2025 16:18:04 +0100 Subject: [PATCH] adds try catch to avoid sending exceptions --- shared/discord.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/shared/discord.py b/shared/discord.py index 8ecbcc6..9b7e262 100644 --- a/shared/discord.py +++ b/shared/discord.py @@ -10,7 +10,10 @@ def send_discord_log_message(message): send_discord_message(DISCORD_LOGS_WEBHOOK_URL, message) def send_discord_message(webhook_url, content): - data = { - "content": content - } - requests.post(webhook_url, json=data) + try: + data = { + "content": content + } + requests.post(webhook_url, json=data) + except Exception as e: + print(f"Failed to send Discord message: {str(e)}")