|
An error while trying to send a request to Azure service. More...
#include <exception.hpp>
Public Member Functions | |
RequestFailedException (std::string const &what) | |
Constructs a new RequestFailedException with a message string. More... | |
RequestFailedException (std::unique_ptr< Azure::Core::Http::RawResponse > &rawResponse) | |
Constructs a new RequestFailedException object with an HTTP raw response. More... | |
RequestFailedException (const RequestFailedException &other) | |
Constructs a new RequestFailedException by copying from an existing one. More... | |
RequestFailedException (RequestFailedException &&other)=default | |
Constructs a new RequestFailedException by moving in an existing one. More... | |
RequestFailedException & | operator= (const RequestFailedException &)=delete |
An instance of RequestFailedException class cannot be assigned. | |
RequestFailedException & | operator= (RequestFailedException &&)=delete |
An instance of RequestFailedException class cannot be moved into another instance after creation. | |
~RequestFailedException ()=default | |
Destructs RequestFailedException . | |
Public Attributes | |
std::unique_ptr< Azure::Core::Http::RawResponse > | RawResponse |
The entire HTTP raw response. | |
Azure::Core::Http::HttpStatusCode | StatusCode = Azure::Core::Http::HttpStatusCode::None |
The HTTP response code. | |
std::string | ReasonPhrase |
The HTTP reason phrase from the response. | |
std::string | ClientRequestId |
The client request header (x-ms-client-request-id ) from the HTTP response. | |
std::string | RequestId |
The request ID header (x-ms-request-id ) from the HTTP response. | |
std::string | ErrorCode |
The error code from service returned in the HTTP response. More... | |
std::string | Message |
The error message from the service returned in the HTTP response. More... | |
A RequestFailedException is sometimes generated as a result of an HTTP response returned from the service, and is sometimes generated for other reasons. The contents of the RequestFailedException depend on whether the exception was thrown as a result of an HTTP response error or other reasons.
To determine which form of RequestFailedException has occurred, a client can check the RequestFailedException::RawResponse
field - if that value is null, then the request failed for some reason other than an HTTP response, the reason can be determined by calling RequestFailedException::what()
.
If the request has failed due to an HTTP response code, the client can inspect other fields in the exception to determine the actual failure returned by the service.
Most Azure services follow the Azure standards for error condition responses and return an error
object containing two properties, code
and message
. These properties are used to populate the RequestFailedException::ErrorCode and RequestFailedException::Message fields
|
explicit |
what | The explanatory string. |
|
explicit |
rawResponse | The HTTP raw response from the service. |
|
inline |
RequestFailedException
.other | The RequestFailedException to be copied. |
|
default |
other | The RequestFailedException to move in. |
std::string Azure::Core::RequestFailedException::ErrorCode |
For more information, see Azure standards for error condition responses, specifically the handling of the "code" property.
Note that the contents of the ErrorCode
is service dependent.
std::string Azure::Core::RequestFailedException::Message |
For more information, see Azure standards for error condition responses, specifically the handling of the "message" property.