| 74 | } |
| 75 | |
| 76 | void 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 | |
| 89 | bool RpcProtocolClient::ValidateResponse(const Json::Value &response) { |
| 90 | if (!response.isObject() || !response.isMember(KEY_ID)) |
no test coverage detected