From fa04fd7a4df376682c1a331331c6c2ffade38a6d Mon Sep 17 00:00:00 2001 From: Jerrie <70805800+Jerrie-Aries@users.noreply.github.com> Date: Mon, 27 Nov 2023 07:47:43 +0800 Subject: [PATCH] Remove `on_error` from classes on views: (#25) - This is in favor of default discord logger that has been implemented in main bot. --- rolemanager/core/views.py | 6 ------ supportutils/core/views.py | 6 ------ 2 files changed, 12 deletions(-) diff --git a/rolemanager/core/views.py b/rolemanager/core/views.py index e7c3b6d..a18119e 100644 --- a/rolemanager/core/views.py +++ b/rolemanager/core/views.py @@ -47,9 +47,6 @@ async def on_submit(self, interaction: Interaction) -> None: await self.followup_callback(interaction, self) - async def on_error(self, interaction: Interaction, error: Exception) -> None: - logger.error("Ignoring exception in modal %r:", self, exc_info=error) - class Select(ui.Select): def __init__(self, category: str, *, options: List[discord.SelectOption], callback: Callback, **kwargs): @@ -102,9 +99,6 @@ def __init__( self.cog: RoleManager = cog super().__init__(timeout=timeout) - async def on_error(self, interaction: Interaction, error: Exception, item: Any) -> None: - logger.error("Ignoring exception in view %r for item %r", self, item, exc_info=error) - def refresh(self) -> None: pass diff --git a/supportutils/core/views.py b/supportutils/core/views.py index 2498d1a..ee75dcd 100644 --- a/supportutils/core/views.py +++ b/supportutils/core/views.py @@ -38,9 +38,6 @@ async def on_submit(self, interaction: Interaction) -> None: self.view.interaction = interaction await self.followup_callback(interaction, self) - async def on_error(self, interaction: Interaction, error: Exception) -> None: - logger.error("Ignoring exception in modal %r:", self, exc_info=error) - class DropdownMenu(ui.Select): def __init__(self, *, options: List[discord.SelectOption], **kwargs): @@ -86,9 +83,6 @@ def __init__( self.cog: SupportUtility = cog self.bot: ModmailBot = cog.bot - async def on_error(self, interaction: Interaction, error: Exception, item: Any) -> None: - logger.error("Ignoring exception in view %r for item %r", self, item, exc_info=error) - async def interaction_check(self, interaction: discord.Interaction) -> bool: raise NotImplementedError