mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-22 00:24:19 +01:00
jsonrpc: Forward errors on malformed requests to cli
We were masquerading errors when parsing the request by reporting only a bogus malformed `id` field in the response, when the real issue was that we were unable to parse the request in the first place (which caused the null-id error to be returned). Fixes #4238
This commit is contained in:
committed by
Rusty Russell
parent
71fafd23fd
commit
b2a5cf422f
@@ -823,8 +823,9 @@ int main(int argc, char *argv[])
|
||||
"Missing 'id' in response '%s'", resp);
|
||||
if (!json_tok_streq(resp, id, idstr))
|
||||
errx(ERROR_TALKING_TO_LIGHTNINGD,
|
||||
"Incorrect 'id' in response: %.*s",
|
||||
json_tok_full_len(id), json_tok_full(resp, id));
|
||||
"Incorrect 'id' (%.*s) in response: %.*s",
|
||||
json_tok_full_len(id), json_tok_full(resp, id),
|
||||
json_tok_full_len(toks), json_tok_full(resp, toks));
|
||||
|
||||
if (!error || json_tok_is_null(resp, error)) {
|
||||
switch (format) {
|
||||
|
||||
Reference in New Issue
Block a user