Browse Source

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>
htlc_accepted_hook
Rusty Russell 6 years ago
committed by Christian Decker
parent
commit
695bec531c
  1. 2
      lightningd/plugin_hook.c

2
lightningd/plugin_hook.c

@ -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);

Loading…
Cancel
Save