FastLED 3.10.8
Loading...
Searching...
No Matches

◆ makeJsonRpcError()

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

Definition at line 69 of file rpc_registry.h.

69 {
70 json response = json::object();
71 response.set("jsonrpc", "2.0");
72
73 json error = json::object();
74 error.set("code", code);
75 error.set("message", message);
76 response.set("error", error);
77
78 if (id.has_value()) {
79 response.set("id", id);
80 }
81
82 return response;
83}
void set(const fl::string &key, const json &value) FL_NO_EXCEPT
Definition json.h:866
static json object() FL_NO_EXCEPT
Definition json.h:857

References fl::FL_NO_EXCEPT, 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: