| 251 | } |
| 252 | |
| 253 | static struct command_result *command_err(struct command *cmd, |
| 254 | struct bcli_result *res, |
| 255 | const char *errmsg) |
| 256 | { |
| 257 | char *err = tal_fmt(cmd, "%s: %s (%.*s)", |
| 258 | res->args, errmsg, (int)res->output_len, res->output); |
| 259 | return command_done_err(cmd, BCLI_ERROR, err, NULL); |
| 260 | } |
| 261 | |
| 262 | /* Don't use this in general: it's better to omit fields. */ |
| 263 | static void json_add_null(struct json_stream *stream, const char *fieldname) |
no test coverage detected