mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-03 10:46:58 +01:00
pylightning: raise Error when missing rpc parameter
This commit is contained in:
parent
6ed54dd34e
commit
d96564ce3e
1 changed files with 3 additions and 0 deletions
|
@ -194,6 +194,9 @@ class Plugin(object):
|
|||
if pos < len(params):
|
||||
# Apply positional args if we have them
|
||||
arguments[k] = params[pos]
|
||||
elif sig.parameters[k].default is inspect.Signature.empty:
|
||||
# This is a positional arg with no value passed
|
||||
raise TypeError("Missing required parameter: %s" % sig.parameters[k])
|
||||
else:
|
||||
# For the remainder apply default args
|
||||
arguments[k] = sig.parameters[k].default
|
||||
|
|
Loading…
Add table
Reference in a new issue