aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2016-12-17 14:44:36 -0500
committerRapptz <[email protected]>2016-12-17 14:44:36 -0500
commitb8909ae38930bd220491dccc12968603daa0cb37 (patch)
treed4bc2c9c6d3b92ba3e146e0cf99c00b476b498e9
parent[commands] Add special extension function 'teardown' for clean-up. (diff)
downloaddiscord.py-b8909ae38930bd220491dccc12968603daa0cb37.tar.xz
discord.py-b8909ae38930bd220491dccc12968603daa0cb37.zip
[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.
-rw-r--r--discord/ext/commands/core.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py
index 9d2836a7..e3f7148f 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