Browse Source

plugin: log response given by plugin if it's invalid JSON.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
plugin-6
Rusty Russell 6 years ago
parent
commit
f653723a85
  1. 3
      lightningd/plugin.c

3
lightningd/plugin.c

@ -276,7 +276,8 @@ static bool plugin_read_json_one(struct plugin *plugin)
toks = json_parse_input(plugin->buffer, plugin->used, &valid); toks = json_parse_input(plugin->buffer, plugin->used, &valid);
if (!toks) { if (!toks) {
if (!valid) { if (!valid) {
plugin_kill(plugin, "Failed to parse JSON response"); plugin_kill(plugin, "Failed to parse JSON response '%.*s'",
(int)plugin->used, plugin->buffer);
return false; return false;
} }
/* We need more. */ /* We need more. */

Loading…
Cancel
Save