rgb-cln/wallet
Mark Beckwith 7f437715d5 Added error code parameter to command_fail
Until now, `command_fail()` reported an error code of -1 for all uses.
This PR adds an `int code` parameter to `command_fail()`, requiring the
caller to explicitly include the error code.

This is part of #1464.

The majority of the calls are used during parameter validation and
their error code is now JSONRPC2_INVALID_PARAMS.

The rest of the calls report an error code of LIGHTNINGD, which I defined to
-1 in `jsonrpc_errors.h`.  The intention here is that as we improve our error
reporting, all occurenaces of LIGHTNINGD will go away and we can eventually
remove it.

I also converted calls to `command_fail_detailed()` that took a `NULL` `data`
parameter to use the new `command_fail()`.

The only difference from an end user perspecive is that bad input errors that
used to be -1 will now be -32602 (JSONRPC2_INVALID_PARAMS).
2018-05-26 12:17:36 +02:00
..
test Added error code parameter to command_fail 2018-05-26 12:17:36 +02:00
.gitignore wallet: Create and manage a sqlite3 database for the wallet 2017-06-06 09:16:10 +09:30
Makefile wallet: add check-source to makefile. 2018-03-07 18:55:51 +01:00
db.c db: full location tags for callers, make it implicit. 2018-04-27 16:20:35 +02:00
db.h db: full location tags for callers, make it implicit. 2018-04-27 16:20:35 +02:00
invoices.c db: track open sqlite3_stmt in DEVELOPER mode. 2018-04-27 16:20:35 +02:00
invoices.h invoice: Check duplicate preimage when explicitly sprcified. 2018-04-26 05:47:09 +00:00
txfilter.c Reduce variable scopes 2018-03-26 01:31:21 +00:00
txfilter.h Use expected LIGHTNING_DIR_FILE_H define 2018-03-25 23:54:21 +00:00
wallet.c wireaddr: new type, ADDR_INTERNAL_FORPROXY, use it if we can't/wont resolve. 2018-05-11 09:15:54 +00:00
wallet.h invoice: Check duplicate preimage when explicitly sprcified. 2018-04-26 05:47:09 +00:00
walletrpc.c Added error code parameter to command_fail 2018-05-26 12:17:36 +02:00
walletrpc.h Use expected LIGHTNING_DIR_FILE_H define 2018-03-25 23:54:21 +00:00