mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 18:11:28 +01:00
lightning-cli: give error message when lightningd produces non-object response.
Nicer than assert() failing without showing the response. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
0dbbd81430
commit
a5e08e7f79
@ -140,6 +140,10 @@ int main(int argc, char *argv[])
|
||||
errx(ERROR_TALKING_TO_LIGHTNINGD,
|
||||
"Malformed response '%s'", resp);
|
||||
|
||||
if (toks->type != JSMN_OBJECT)
|
||||
errx(ERROR_TALKING_TO_LIGHTNINGD,
|
||||
"Non-object response '%s'", resp);
|
||||
|
||||
result = json_get_member(resp, toks, "result");
|
||||
if (!result)
|
||||
errx(ERROR_TALKING_TO_LIGHTNINGD,
|
||||
|
Loading…
Reference in New Issue
Block a user