From 2ad532c6ebd85166050e5918c1471fb2a738f91c Mon Sep 17 00:00:00 2001 From: hypergonial Date: Sat, 25 May 2024 00:26:24 +0200 Subject: [PATCH] Fix slash subcommand error handler --- arc/command/slash.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arc/command/slash.py b/arc/command/slash.py index d85888a..759b17a 100644 --- a/arc/command/slash.py +++ b/arc/command/slash.py @@ -546,7 +546,7 @@ async def _handle_exception(self, ctx: Context[ClientT], exc: Exception) -> None raise exc except Exception as exc: assert self._parent is not None - await ctx._injection_ctx.call_with_async_di(self._parent._handle_exception, ctx, exc) + await self._parent._handle_exception(ctx, exc) def _request_option_locale(self, client: Client[t.Any], command: CommandProto) -> None: super()._request_option_locale(client, command) @@ -694,12 +694,12 @@ def _resolve_concurrency_limiter(self) -> ConcurrencyLimiterProto[ClientT] | Non async def _handle_exception(self, ctx: Context[ClientT], exc: Exception) -> None: try: if self.error_handler: - await self.error_handler(ctx, exc) + await ctx._injection_ctx.call_with_async_di(self.error_handler, ctx, exc) else: raise exc except Exception as e: assert self._parent is not None - await self._handle_exception(ctx, e) + await self._parent._handle_exception(ctx, e) def _request_option_locale(self, client: Client[t.Any], command: CommandProto) -> None: super()._request_option_locale(client, command)