Skip to content

Commit

Permalink
plugin: fix printing of bad plugin responses.
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
rustyrussell authored and cdecker committed May 31, 2019
1 parent 8f9c482 commit 695bec5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lightningd/plugin_hook.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 695bec5

Please sign in to comment.