MCPcopy Create free account
hub / github.com/ElementsProject/lightning / commando_error

Function commando_error

plugins/commando.c:199–217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

197 PRINTF_FMT(4, 5);
198
199static 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
219struct cond_info {
220 /* The commando message (and our parent!) */

Callers 3

checkrune_doneFunction · 0.85
checkrune_failedFunction · 0.85
try_commandFunction · 0.85

Calls 4

tal_append_vfmtFunction · 0.85
tal_append_fmtFunction · 0.85
tal_bytelenFunction · 0.85
send_responseFunction · 0.85

Tested by

no test coverage detected