MCPcopy Create free account
hub / github.com/cinemast/libjson-rpc-cpp / WrapError

Method WrapError

src/jsonrpccpp/server/rpcprotocolserverv1.cpp:53–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53void RpcProtocolServerV1::WrapError(const Json::Value &request, int code, const std::string &message, Json::Value &result) {
54 result["error"]["code"] = code;
55 result["error"]["message"] = message;
56 result["result"] = Json::nullValue;
57 if (request.isObject() && request.isMember("id")) {
58 result["id"] = request["id"];
59 } else {
60 result["id"] = Json::nullValue;
61 }
62}
63
64void RpcProtocolServerV1::WrapException(const Json::Value &request, const JsonRpcException &exception, Json::Value &result) {
65 this->WrapError(request, exception.GetCode(), exception.GetMessage(), result);

Callers 4

HandleJsonRequestMethod · 0.95
WrapExceptionMethod · 0.95
HandleRequestMethod · 0.45
HandleRequestMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected