mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-22 08:44:10 +00:00
[commands] Raise RuntimeError instead of StopIteration.
This commit is contained in:
parent
b9873ea04e
commit
baf1312d0e
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user