Skip to content

Commit

Permalink
Fix slash subcommand error handler
Browse files Browse the repository at this point in the history
  • Loading branch information
hypergonial committed May 24, 2024
1 parent aae8df8 commit 2ad532c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions arc/command/slash.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 2ad532c

Please sign in to comment.