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 <dev@disqualifier.me>
This commit is contained in:
1 parent
caf0c3ee5c
commit
675eac310e
1 file changed
-5
@@ -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
|
||||
|
||||
attachments = list(message.attachments)
|
||||
if len(attachments) != len(group):
|
||||
|
||||
Reference in new issue
Block a user