refactor: drop the pass-through try/excepts around create and delete
T3-21: except discord.HTTPException: raise did nothing; the exceptions already propagate unwrapped. Signed-off-by: disqualifier <dev@disqualifier.me>
This commit is contained in:
1 parent
7adb8dc386
commit
5681efe1e0
1 file changed
-9
@@ -172,22 +172,13 @@ class DPYAppEmojis:
|
||||
|
||||
for name in to_create:
|
||||
image = await asyncio.to_thread(_read_file, desired[name])
|
||||
try:
|
||||
emoji = await self._client.create_application_emoji(name=name, image=image)
|
||||
except discord.HTTPException:
|
||||
# raise XOR log: this re-raises, so the exception carries the failure to the
|
||||
# caller (who decides fatal-vs-routine) - no error log here would double-report.
|
||||
raise
|
||||
current[name] = emoji
|
||||
result.created.append(name)
|
||||
|
||||
for name, emoji in list(existing.items()):
|
||||
if name not in desired:
|
||||
try:
|
||||
await emoji.delete()
|
||||
except discord.HTTPException:
|
||||
# raise XOR log: re-raises, so the exception is the signal - no log here.
|
||||
raise
|
||||
current.pop(name, None)
|
||||
result.deleted.append(name)
|
||||
|
||||
|
||||
Reference in new issue
Block a user