| 35 | } |
| 36 | |
| 37 | void RpcProtocolClient::HandleResponse(const std::string &response, Json::Value &result) { |
| 38 | Json::Value value; |
| 39 | |
| 40 | try { |
| 41 | if (std::istringstream(response) >> value) { |
| 42 | this->HandleResponse(value, result); |
| 43 | } else { |
| 44 | throw JsonRpcException(Errors::ERROR_RPC_JSON_PARSE_ERROR, " " + response); |
| 45 | } |
| 46 | } catch (Json::Exception &e) { |
| 47 | throw JsonRpcException(Errors::ERROR_RPC_JSON_PARSE_ERROR, " " + response); |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | Json::Value RpcProtocolClient::HandleResponse(const Json::Value &value, Json::Value &result) { |
| 52 | if (this->ValidateResponse(value)) { |
no test coverage detected