handle kinds of error message

update test case and reduce duplicate code
This commit is contained in:
zhangzifa
2019-02-08 12:40:59 +08:00
committed by Jackson Tian
parent da28515bd8
commit ae7e11733f
15 changed files with 111 additions and 145 deletions

View File

@@ -53,8 +53,6 @@ namespace AlibabaCloud
JsonOutcome makeRequest(const std::string &endpoint, const CommonRequest &msg, HttpRequest::Method method = HttpRequest::Method::Get)const;
using CoreClient::asyncExecute;
private:
std::string canonicalizedQuery(const std::map <std::string, std::string> &params)const;
std::string canonicalizedHeaders(const HttpMessage::HeaderCollection &headers)const;
std::shared_ptr<CredentialsProvider> credentialsProvider_;
std::shared_ptr<Signer> signer_;

View File

@@ -33,15 +33,18 @@ namespace AlibabaCloud
std::string errorMessage() const;
std::string host() const;
std::string requestId() const;
std::string detail() const;
void setErrorCode(const std::string &code);
void setErrorMessage(const std::string& message);
void setHost(const std::string& host);
void setRequestId(const std::string& request);
void setDetail(const std::string& detail);
private:
std::string errorCode_;
std::string message_;
std::string host_;
std::string requestId_;
std::string detail_;
};
}

View File

@@ -44,9 +44,6 @@ namespace AlibabaCloud
virtual HttpRequest buildHttpRequest(const std::string & endpoint, const ServiceRequest &msg, HttpRequest::Method method)const override;
HttpRequest buildHttpRequest(const std::string & endpoint, const RoaServiceRequest &msg, HttpRequest::Method method)const;
private:
std::string canonicalizedHeaders(const HttpMessage::HeaderCollection &headers)const;
std::string canonicalizedResource(const std::string &path, std::map <std::string, std::string> &params)const;
std::shared_ptr<CredentialsProvider> credentialsProvider_;
std::shared_ptr<Signer> signer_;
};

View File

@@ -53,8 +53,6 @@ namespace AlibabaCloud
virtual HttpRequest buildHttpRequest(const std::string & endpoint, const ServiceRequest &msg, HttpRequest::Method method)const override;
HttpRequest buildHttpRequest(const std::string & endpoint, const RpcServiceRequest &msg, HttpRequest::Method method)const;
private:
std::string canonicalizedQuery(const std::map <std::string, std::string> &params)const;
std::shared_ptr<CredentialsProvider> credentialsProvider_;
std::shared_ptr<Signer> signer_;
};