diff options
| author | 2020-07-16 20:27:32 +0200 | |
|---|---|---|
| committer | 2020-07-16 20:27:32 +0200 | |
| commit | 476d4070940830d14859f7cc8970a14409d142a6 (patch) | |
| tree | 730b496cb16dcc03702227d91ec738293d4af27f | |
| parent | Merge 'master' into 'kwzrd/incidents'; resolve config conflicts (diff) | |
Incidents: reduce log level of 403 exception
In addition to 404, this shouldn't send Sentry notifs.
Co-authored-by: MarkKoz <[email protected]>
| -rw-r--r-- | bot/cogs/moderation/incidents.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/bot/cogs/moderation/incidents.py b/bot/cogs/moderation/incidents.py index 2d5f26f20..3605ab1d2 100644 --- a/bot/cogs/moderation/incidents.py +++ b/bot/cogs/moderation/incidents.py @@ -51,12 +51,13 @@ async def download_file(attachment: discord.Attachment) -> t.Optional[discord.Fi Download & return `attachment` file. If the download fails, the reason is logged and None will be returned. + 404 and 403 errors are only logged at debug level. """ log.debug(f"Attempting to download attachment: {attachment.filename}") try: return await attachment.to_file() - except discord.NotFound as not_found: - log.debug(f"Failed to download attachment: {not_found}") + except (discord.NotFound, discord.Forbidden) as exc: + log.debug(f"Failed to download attachment: {exc}") except Exception: log.exception("Failed to download attachment") |