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

Method throwErrorException

src/jsonrpccpp/client/rpcprotocolclient.cpp:76–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74}
75
76void RpcProtocolClient::throwErrorException(const Json::Value &response) {
77 if (response[KEY_ERROR].isMember(KEY_ERROR_MESSAGE) && response[KEY_ERROR][KEY_ERROR_MESSAGE].isString()) {
78 if (response[KEY_ERROR].isMember(KEY_ERROR_DATA)) {
79 throw JsonRpcException(response[KEY_ERROR][KEY_ERROR_CODE].asInt(), response[KEY_ERROR][KEY_ERROR_MESSAGE].asString(),
80 response[KEY_ERROR][KEY_ERROR_DATA]);
81 } else {
82 throw JsonRpcException(response[KEY_ERROR][KEY_ERROR_CODE].asInt(), response[KEY_ERROR][KEY_ERROR_MESSAGE].asString());
83 }
84 } else {
85 throw JsonRpcException(response[KEY_ERROR][KEY_ERROR_CODE].asInt());
86 }
87}
88
89bool RpcProtocolClient::ValidateResponse(const Json::Value &response) {
90 if (!response.isObject() || !response.isMember(KEY_ID))

Callers 1

HandleResponseMethod · 0.95

Calls 1

JsonRpcExceptionClass · 0.50

Tested by

no test coverage detected