plugin: fix printing of bad plugin responses.

Before:
	Plugin for invoice_payment returned non-result response 

	"subscriptions": [], "hooks": ["invoice_payment"]}}

	�V

After:
	Plugin for invoice_payment returned non-result response {"jsonrpc": "2.0", "id": 6, "error": "Error while processing invoice_payment: ValueError(\"invalid literal for int() with base 10: '5.0'\")"}

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2019-05-31 11:31:22 +09:30 committed by Christian Decker
parent 8f9c48254b
commit 695bec531c

View File

@ -54,7 +54,7 @@ static void plugin_hook_callback(const char *buffer, const jsmntok_t *toks,
if (!resulttok)
fatal("Plugin for %s returned non-result response %.*s",
r->hook->name,
toks->end - toks->start, buffer + toks->end);
toks->end - toks->start, buffer + toks->start);
db_begin_transaction(r->db);
r->hook->response_cb(r->cb_arg, buffer, resulttok);