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:
lisa neigut
2019-08-27 22:38:12 -05:00
committed by Rusty Russell
parent f784863603
commit 2fe490294e
2 changed files with 12 additions and 0 deletions

View File

@@ -263,6 +263,13 @@ struct command_result *command_done_err(struct command *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)
{
assert(in_timer > 0);