FastLED 3.9.15
Loading...
Searching...
No Matches

◆ makeJsonRpcError()

json fl::detail::makeJsonRpcError ( int code,
const fl::string & message,
const json & id )
inline

Definition at line 61 of file rpc_registry.h.

61 {
62 json response = json::object();
63 response.set("jsonrpc", "2.0");
64
65 json error = json::object();
66 error.set("code", code);
67 error.set("message", message);
68 response.set("error", error);
69
70 if (id.has_value()) {
71 response.set("id", id);
72 }
73
74 return response;
75}
void set(const fl::string &key, const json &value) FL_NOEXCEPT
Definition json.h:701
static json object() FL_NOEXCEPT
Definition json.h:692

References fl::json::object(), and fl::json::set().

Referenced by fl::Rpc::handle().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: