aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2016-02-06 01:38:41 -0500
committerRapptz <[email protected]>2016-02-06 01:38:41 -0500
commitbaf1312d0e9001191b7788aa47f4cfa3e56e5933 (patch)
tree790460b32e7223570fdc0f907ec662901c4698d0
parentAdd new US Central and US South voice regions. (diff)
downloaddiscord.py-baf1312d0e9001191b7788aa47f4cfa3e56e5933.tar.xz
discord.py-baf1312d0e9001191b7788aa47f4cfa3e56e5933.zip
[commands] Raise RuntimeError instead of StopIteration.
-rw-r--r--discord/ext/commands/core.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py
index 94f500d5..a7963cbb 100644
--- a/discord/ext/commands/core.py
+++ b/discord/ext/commands/core.py
@@ -227,7 +227,7 @@ class Command:
if view.eof:
if param.kind == param.VAR_POSITIONAL:
- raise StopIteration() # break the loop
+ raise RuntimeError() # break the loop
if required:
raise MissingRequiredArgument('{0.name} is a required argument that is missing.'.format(param))
return param.default
@@ -306,8 +306,9 @@ class Command:
try:
transformed = yield from self.transform(ctx, param)
args.append(transformed)
- except StopIteration:
+ except RuntimeError:
break
+
except CommandError as e:
self.handle_local_error(e, ctx)
ctx.bot.dispatch('command_error', e, ctx)