22 #include "olp/core/client/ErrorCode.h"
23 #include "olp/core/http/NetworkTypes.h"
38 SWITCHING_PROTOCOLS = 101,
43 NON_AUTHORITATIVE_INFORMATION = 203,
46 PARTIAL_CONTENT = 206,
48 ALREADY_REPORTED = 208,
50 MULTIPLE_CHOICES = 300,
51 MOVED_PERMANENTLY = 301,
57 TEMPORARY_REDIRECT = 307,
58 PERMANENT_REDIRECT = 308,
61 PAYMENT_REQUIRED = 402,
64 METHOD_NOT_ALLOWED = 405,
66 PROXY_AUTHENTICATION_REQUIRED = 407,
67 REQUEST_TIMEOUT = 408,
70 LENGTH_REQUIRED = 411,
71 PRECONDITION_FAILED = 412,
72 REQUEST_ENTITY_TOO_LARGE = 413,
73 REQUEST_URI_TOO_LONG = 414,
74 UNSUPPORTED_MEDIA_TYPE = 415,
75 REQUESTED_RANGE_NOT_SATISFIABLE = 416,
76 EXPECTATION_FAILED = 417,
78 AUTHENTICATION_TIMEOUT = 419,
82 FAILED_DEPENDENCY = 424,
83 UPGRADE_REQUIRED = 426,
84 PRECONDITION_REQUIRED = 427,
85 TOO_MANY_REQUESTS = 429,
86 REQUEST_HEADER_FIELDS_TOO_LARGE = 431,
92 REQUEST_HEADER_TOO_LARGE = 494,
95 HTTP_TO_HTTPS_PORT = 497,
96 CLIENT_CLOSED_REQUEST = 499,
97 INTERNAL_SERVER_ERROR = 500,
98 NOT_IMPLEMENTED = 501,
100 SERVICE_UNAVAILABLE = 503,
101 GATEWAY_TIMEOUT = 504,
102 VERSION_NOT_SUPPORTED = 505,
103 VARIANT_ALSO_NEGOTIATES = 506,
104 INSUFFICIENT_STORAGE = 507,
106 BANDWIDTH_LIMIT_EXCEEDED = 509,
108 NETWORK_AUTHENTICATION_REQUIRED = 511,
109 NETWORK_READ_TIMEOUT = 598,
110 NETWORK_CONNECT_TIMEOUT = 599,
128 case HttpStatusCode::INTERNAL_SERVER_ERROR:
129 case HttpStatusCode::SERVICE_UNAVAILABLE:
130 case HttpStatusCode::TOO_MANY_REQUESTS:
131 case HttpStatusCode::BANDWIDTH_LIMIT_EXCEEDED:
132 case HttpStatusCode::REQUEST_TIMEOUT:
133 case HttpStatusCode::AUTHENTICATION_TIMEOUT:
134 case HttpStatusCode::LOGIN_TIMEOUT:
135 case HttpStatusCode::GATEWAY_TIMEOUT:
136 case HttpStatusCode::NETWORK_READ_TIMEOUT:
137 case HttpStatusCode::NETWORK_CONNECT_TIMEOUT:
156 case olp::http::ErrorCode::OFFLINE_ERROR:
158 case olp::http::ErrorCode::IO_ERROR:
162 case olp::http::ErrorCode::CANCELLED_ERROR:
164 case olp::http::ErrorCode::AUTHORIZATION_ERROR:
165 case olp::http::ErrorCode::AUTHENTICATION_ERROR:
167 case olp::http::ErrorCode::INVALID_URL_ERROR:
179 case HttpStatusCode::BAD_REQUEST:
181 case HttpStatusCode::UNAUTHORIZED:
182 case HttpStatusCode::FORBIDDEN:
184 case HttpStatusCode::NOT_FOUND:
186 case HttpStatusCode::PRECONDITION_FAILED:
188 case HttpStatusCode::TOO_MANY_REQUESTS:
189 case HttpStatusCode::BANDWIDTH_LIMIT_EXCEEDED:
191 case HttpStatusCode::INTERNAL_SERVER_ERROR:
193 case HttpStatusCode::SERVICE_UNAVAILABLE:
195 case HttpStatusCode::REQUEST_TIMEOUT:
196 case HttpStatusCode::AUTHENTICATION_TIMEOUT:
197 case HttpStatusCode::LOGIN_TIMEOUT:
198 case HttpStatusCode::GATEWAY_TIMEOUT:
199 case HttpStatusCode::NETWORK_READ_TIMEOUT:
200 case HttpStatusCode::NETWORK_CONNECT_TIMEOUT:
HTTP status codes, as specified in RFC7231.
Definition: HttpStatusCode.h:34
static olp::client::ErrorCode GetErrorCode(int http_code)
Maps an HTTP status code or olp::http::ErrorCode to olp::client::ErrorCode.
Definition: HttpStatusCode.h:152
static bool IsRetryable(int http_code)
Checks if the given error code is a temporary error.
Definition: HttpStatusCode.h:123
ErrorCode
Represents all possible errors that might happen during a user request.
Definition: ErrorCode.h:29
ErrorCode
The common Network error codes.
Definition: NetworkTypes.h:54
@ UNKNOWN_ERROR
Internal error that can't be interpreted.
Rules all the other namespaces.
Definition: AppleSignInProperties.h:24