From b6a888d218276d473f29a2cf5d413843cb156b1a Mon Sep 17 00:00:00 2001 From: Amrou Bellalouna Date: Wed, 20 Mar 2024 20:13:48 +0100 Subject: Extract original error upon exceptions, if any (#209) --- pydis_core/utils/error_handling/commands/manager.py | 1 + 1 file changed, 1 insertion(+) (limited to 'pydis_core') diff --git a/pydis_core/utils/error_handling/commands/manager.py b/pydis_core/utils/error_handling/commands/manager.py index 81e6a269..8f07f6bf 100644 --- a/pydis_core/utils/error_handling/commands/manager.py +++ b/pydis_core/utils/error_handling/commands/manager.py @@ -29,6 +29,7 @@ class CommandErrorManager: Iterate through available handlers by registration order, and choose the first one capable of handling the error as determined by `should_handle_error`; there is no priority system. """ + error = getattr(error, "original", error) for handler in self._handlers + [self._default]: if await handler.should_handle_error(error): callback = self._get_callback(handler, context_or_interaction) -- cgit v1.2.3