mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +01:00
libplugin: new helper method for passing a raw error
Makes it easier to stash an error and then return it after another RPC call has been made.
This commit is contained in:
parent
f784863603
commit
2fe490294e
@ -263,6 +263,13 @@ struct command_result *command_done_err(struct command *cmd,
|
|||||||
return end_cmd(cmd);
|
return end_cmd(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct command_result *command_err_raw(struct command *cmd,
|
||||||
|
const char *json_str)
|
||||||
|
{
|
||||||
|
return command_done_raw(cmd, "error",
|
||||||
|
json_str, strlen(json_str));
|
||||||
|
}
|
||||||
|
|
||||||
struct command_result *timer_complete(void)
|
struct command_result *timer_complete(void)
|
||||||
{
|
{
|
||||||
assert(in_timer > 0);
|
assert(in_timer > 0);
|
||||||
|
@ -62,6 +62,11 @@ command_done_err(struct command *cmd,
|
|||||||
const char *errmsg,
|
const char *errmsg,
|
||||||
const struct json_out *data);
|
const struct json_out *data);
|
||||||
|
|
||||||
|
/* Send a raw error response. Useful for forwarding a previous
|
||||||
|
* error after cleanup */
|
||||||
|
struct command_result *command_err_raw(struct command *cmd,
|
||||||
|
const char *json_str);
|
||||||
|
|
||||||
/* This command is finished, here's the result object; @cmd cannot be NULL. */
|
/* This command is finished, here's the result object; @cmd cannot be NULL. */
|
||||||
struct command_result *WARN_UNUSED_RESULT
|
struct command_result *WARN_UNUSED_RESULT
|
||||||
command_success(struct command *cmd, const struct json_out *result);
|
command_success(struct command *cmd, const struct json_out *result);
|
||||||
|
Loading…
Reference in New Issue
Block a user