From 5681efe1e0388d7968a8b5811feda94e472e4b88 Mon Sep 17 00:00:00 2001 From: disqualifier Date: Fri, 16 Oct 2026 04:36:32 -0400 Subject: [PATCH] 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 --- src/dpy_appemojis/dpy_appemojis.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/dpy_appemojis/dpy_appemojis.py b/src/dpy_appemojis/dpy_appemojis.py index 11e4fe8..0844470 100644 --- a/src/dpy_appemojis/dpy_appemojis.py +++ b/src/dpy_appemojis/dpy_appemojis.py @@ -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 + emoji = await self._client.create_application_emoji(name=name, image=image) 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 + await emoji.delete() current.pop(name, None) result.deleted.append(name)