jsonrpc: make error codes an enum.

This allows GDB to print values, but also allows us to use them in
'case' statements.  This wasn't allowed before because they're not
constant terms.

This also made it clear there's a clash between two error codes,
so move one.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Changed: JSON-RPC: Error code from bcli plugin changed from 400 to 500.
This commit is contained in:
Rusty Russell
2022-09-18 09:50:50 +09:30
parent 7fa1364645
commit 2da5244e83
31 changed files with 152 additions and 152 deletions

View File

@@ -239,7 +239,7 @@ void NORETURN plugin_exit(struct plugin *p, int exitcode);
* NULL, data can be NULL; otherwise it must be a JSON object. */
struct command_result *WARN_UNUSED_RESULT
command_done_err(struct command *cmd,
errcode_t code,
enum jsonrpc_errcode code,
const char *errmsg,
const struct json_out *data);