From b8909ae38930bd220491dccc12968603daa0cb37 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Sat, 17 Dec 2016 14:44:36 -0500 Subject: [PATCH] [commands] Properly propagate CommandError derived exceptions. If a command or a group raised a CommandError derived exception it would be wrapped into CommandInvokeError. This fixes this case so it raises the original exception instead. --- discord/ext/commands/core.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py index 9d2836a75..e3f7148f2 100644 --- a/discord/ext/commands/core.py +++ b/discord/ext/commands/core.py @@ -48,6 +48,8 @@ def inject_context(ctx, coro): try: ret = yield from coro(*args, **kwargs) + except CommandError: + raise except Exception as e: raise CommandInvokeError(e) from e return ret