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

Function commando_error

plugins/commando.c:202–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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