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

Method HandleSingleRequest

src/jsonrpccpp/server/rpcprotocolserverv2.cpp:30–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28 }
29}
30void RpcProtocolServerV2::HandleSingleRequest(const Json::Value &req, Json::Value &response) {
31 int error = this->ValidateRequest(req);
32 if (error == 0) {
33 try {
34 this->ProcessRequest(req, response);
35 } catch (const JsonRpcException &exc) {
36 this->WrapException(req, exc, response);
37 }
38 } else {
39 this->WrapError(req, error, Errors::GetErrorMessage(error), response);
40 }
41}
42void RpcProtocolServerV2::HandleBatchRequest(const Json::Value &req, Json::Value &response) {
43 if (req.empty())
44 this->WrapError(Json::nullValue, Errors::ERROR_RPC_INVALID_REQUEST, Errors::GetErrorMessage(Errors::ERROR_RPC_INVALID_REQUEST), response);

Callers 2

HandleJsonRequestMethod · 0.95
HandleBatchRequestMethod · 0.95

Calls 4

WrapExceptionMethod · 0.95
WrapErrorMethod · 0.95
ValidateRequestMethod · 0.80
ProcessRequestMethod · 0.45

Tested by

no test coverage detected