From 675eac310e5daae7820242b849669ecc10095147 Mon Sep 17 00:00:00 2001 From: disqualifier Date: Fri, 16 Oct 2026 04:20:22 -0400 Subject: [PATCH] refactor: drop the pass-through try/except around channel.send T3-21: except discord.HTTPException: raise did nothing; the exception already propagates unwrapped. Signed-off-by: disqualifier --- src/dpy_cache/dpy_cache.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/dpy_cache/dpy_cache.py b/src/dpy_cache/dpy_cache.py index ab6573c..99cf9cc 100644 --- a/src/dpy_cache/dpy_cache.py +++ b/src/dpy_cache/dpy_cache.py @@ -140,12 +140,7 @@ class DPYCache: for start in range(0, len(items), MAX_ATTACHMENTS_PER_MESSAGE): group = items[start:start + MAX_ATTACHMENTS_PER_MESSAGE] discord_files = [self._to_file(name, source) for name, source in group] - try: - message = await self._channel.send(content=content, files=discord_files) - except discord.HTTPException: - # raise XOR log: HTTPException propagates unwrapped (the documented contract), - # so the exception carries the failure to the caller - no error log here. - raise + message = await self._channel.send(content=content, files=discord_files) attachments = list(message.attachments) if len(attachments) != len(group):