olp-cpp-sdk
1.21.0
|
A wrapper around an internal error or HTTP status code. More...
#include <ApiError.h>
Public Member Functions | |
ApiError (ErrorCode error_code, std::string message, bool is_retryable=false) | |
Creates the ApiError instance with the internal error. More... | |
ApiError (int http_status_code, std::string message="") | |
Creates the ApiError instance with the HTTP status code. More... | |
ErrorCode | GetErrorCode () const |
Gets the error code. More... | |
int | GetHttpStatusCode () const |
Gets the HTTP status code. More... | |
const std::string & | GetMessage () const |
Gets the error message. More... | |
bool | ShouldRetry () const |
Checks if the request can be retried for this error. More... | |
Static Public Member Functions | |
static ApiError | Cancelled (const char *message="Cancelled") |
Creates the ApiError instance with the cancelled error code and description. More... | |
static ApiError | NetworkConnection (const char *message="Offline") |
Creates the ApiError instance with the network connection error code and description. More... | |
static ApiError | PreconditionFailed (const char *message="Precondition failed") |
Creates the ApiError instance with the precondition failed error code and description. More... | |
static ApiError | InvalidArgument (const char *message="Invalid argument") |
Creates the ApiError instance with the invalid argument error code and description. More... | |
static ApiError | NotFound (const char *message="Resource not found") |
Creates the ApiError instance with the not found error code and description. More... | |
static ApiError | CacheIO (const char *description="Cache IO") |
Creates the ApiError instance with the cache IO error code and description. More... | |
static ApiError | Unknown (const char *message="Unknown") |
Creates the ApiError instance with the unknown error code and description. More... | |
A wrapper around an internal error or HTTP status code.
|
inline |
Creates the ApiError
instance with the internal error.
Represents the internal error that is not related to any HTTP status returned during the request. You can call this constructor using the error code and error message.
error_code | The internal error code. |
message | The text message of the error. |
is_retryable | Indicates if the error is permanent or temporary and if the user can retry the operation. |
|
inline |
Creates the ApiError
instance with the HTTP status code.
Represents the server status. Evaluates the HTTP status code and sets the error_code_
and is_retriable_ flag
parameters. You can call this constructor using the HTTP status code and error text message.
http_status_code | The HTTP status code returned by the server. |
message | The text message of the error. |
|
inlinestatic |
|
inlinestatic |
|
inline |
Gets the error code.
|
inline |
Gets the HTTP status code.
|
inline |
Gets the error message.
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inline |
Checks if the request can be retried for this error.
|
inlinestatic |