| 197 | PRINTF_FMT(4, 5); |
| 198 | |
| 199 | static struct command_result *commando_error(struct command *cmd, |
| 200 | struct commando *incoming, |
| 201 | int ecode, |
| 202 | const char *fmt, ...) |
| 203 | { |
| 204 | struct reply *reply = tal(plugin, struct reply); |
| 205 | va_list ap; |
| 206 | |
| 207 | reply->incoming = tal_steal(reply, incoming); |
| 208 | reply->buf = tal_fmt(reply, "{\"error\":{\"code\":%i,\"message\":\"", ecode); |
| 209 | va_start(ap, fmt); |
| 210 | tal_append_vfmt(&reply->buf, fmt, ap); |
| 211 | va_end(ap); |
| 212 | tal_append_fmt(&reply->buf, "\"}}"); |
| 213 | reply->off = 0; |
| 214 | reply->len = tal_bytelen(reply->buf) - 1; |
| 215 | |
| 216 | return send_response(cmd, NULL, NULL, NULL, reply); |
| 217 | } |
| 218 | |
| 219 | struct cond_info { |
| 220 | /* The commando message (and our parent!) */ |
no test coverage detected