mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
pylightning: raise Error when missing rpc parameter
This commit is contained in:
committed by
Christian Decker
parent
6ed54dd34e
commit
d96564ce3e
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user