[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.
This commit is contained in:
parent
6d88024f0f
commit
b8909ae389
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user