pyln-client: send proper JSONRPC2 errors on failed call

Changelog-Added: pyln now sends proper error on bad calls to plugin methods

Co-Authored-By: Sergi Delgado Segura <sergi.delgado.s@gmail.com>
This commit is contained in:
darosior
2020-04-10 00:47:01 +02:00
committed by Rusty Russell
parent 813356b88c
commit af76bce0fa
3 changed files with 17 additions and 3 deletions

View File

@@ -19,6 +19,12 @@ def hello(plugin, name="world"):
return s
@plugin.method("bye")
def bye(plugin, name, **kwargs):
"""This methods requires {name} to be set by the caller !"""
return "Bye {}".format(name)
@plugin.init()
def init(options, configuration, plugin, **kwargs):
plugin.log("Plugin helloworld.py initialized")