renamed error code

Signed-off-by: Mark Beckwith <wythe@intrig.com>
This commit is contained in:
Mark Beckwith
2018-07-28 12:34:17 -05:00
committed by Christian Decker
parent 381c32af75
commit 428da65fb1
2 changed files with 6 additions and 4 deletions

View File

@@ -15,7 +15,9 @@
* with a specific error code, and then removed. * with a specific error code, and then removed.
*/ */
#define LIGHTNINGD -1 #define LIGHTNINGD -1
#define LIGHTNINGD_INTERNAL -2
/* Developer error in the parameters to param() call */
#define PARAM_DEV_ERROR -2
/* Errors from `pay`, `sendpay`, or `waitsendpay` commands */ /* Errors from `pay`, `sendpay`, or `waitsendpay` commands */
#define PAY_IN_PROGRESS 200 #define PAY_IN_PROGRESS 200

View File

@@ -284,7 +284,7 @@ static bool param_arr(struct command *cmd, const char *buffer,
{ {
#if DEVELOPER #if DEVELOPER
if (!check_params(params)) { if (!check_params(params)) {
command_fail(cmd, LIGHTNINGD_INTERNAL, "programmer error"); command_fail(cmd, PARAM_DEV_ERROR, "programmer error");
return false; return false;
} }
#endif #endif
@@ -312,8 +312,8 @@ bool param(struct command *cmd, const char *buffer,
void *arg = va_arg(ap, void *); void *arg = va_arg(ap, void *);
size_t argsize = va_arg(ap, size_t); size_t argsize = va_arg(ap, size_t);
if (!param_add(&params, name, required, cb, arg, argsize)) { if (!param_add(&params, name, required, cb, arg, argsize)) {
command_fail(cmd, LIGHTNINGD_INTERNAL, command_fail(cmd, PARAM_DEV_ERROR, "programmer error");
"programmer error"); va_end(ap);
return false; return false;
} }
} }