aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar kwzrd <[email protected]>2020-06-13 22:09:44 +0200
committerGravatar kwzrd <[email protected]>2020-06-13 22:19:36 +0200
commit7c43eff17a07471799174c0a0e8813b9f58d2ab5 (patch)
tree2acea03b78a4dcfa081e8c6bbff9c17ce567d7b7
parentIncidents tests: write tests for `resolve_message` (diff)
Incidents: log error on non-404 response
We do not wish to log 404 exceptions as those are expected, however, if something else goes wrong, we shouldn't silence it. This also removes the explicit None return as it only adds syntax noise.
-rw-r--r--bot/cogs/moderation/incidents.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/bot/cogs/moderation/incidents.py b/bot/cogs/moderation/incidents.py
index 151584d38..16286bdab 100644
--- a/bot/cogs/moderation/incidents.py
+++ b/bot/cogs/moderation/incidents.py
@@ -274,9 +274,10 @@ class Incidents(Cog):
log.debug("Message not found, attempting to fetch")
try:
message = await self.bot.get_channel(Channels.incidents).fetch_message(message_id)
+ except discord.NotFound:
+ log.debug("Message doesn't exist, it was likely already relayed")
except Exception as exc:
- log.debug(f"Failed to fetch message: {exc}")
- return None
+ log.exception("Failed to fetch message!", exc_info=exc)
else:
log.debug("Message fetched successfully!")
return message