Google APIs Client Library for C++
|
forward declaration More...
#include "client/transport/http_transport.h"
Public Types | |
typedef ResultCallback2< bool, int, HttpRequest * > | HttpCodeHandler |
Callback for handling a specific HTTP status code. | |
Public Member Functions | |
void | ResetHttpCodeHandler (int code, HttpCodeHandler *handler) |
Replaces the existing handler for a given HTTP status code. | |
HttpTransportErrorHandler () | |
Standard constructor. | |
virtual | ~HttpTransportErrorHandler () |
Standard destructor. | |
virtual bool | HandleTransportError (int num_retries_so_far, HttpRequest *request) const |
Handles transport errors. | |
virtual bool | HandleRedirect (int num_redirects_so_far, HttpRequest *request) const |
Handles HTTP redirects (HTTP 3xx series results). | |
virtual bool | HandleHttpError (int num_retries_so_far, HttpRequest *request) const |
Handles erorrs from requests with HTTP status code errors. |
forward declaration
Specifies the error handling policy for HTTP messaging.
This class specifies the policy for different types of errors including:
Instances can further refine specific error handling for individual HTTP status codes.
typedef ResultCallback2<bool, int, HttpRequest*> HttpCodeHandler |
Callback for handling a specific HTTP status code.
[in] | int | The HTTP status code. |
[in] | HttpRequest | The request that had the error. |
The callback and make changes to the request to indicate how to perform a retry.
Standard constructor.
virtual ~HttpTransportErrorHandler | ( | ) | [virtual] |
Standard destructor.
virtual bool HandleHttpError | ( | int | num_retries_so_far, |
HttpRequest * | request | ||
) | const [virtual] |
Handles erorrs from requests with HTTP status code errors.
This includes 401 (Authorization) and 503 (Unavailable)
[in] | num_retries_so_far | Number of retries performed already. |
[in] | request | The request that returned the error. |
virtual bool HandleRedirect | ( | int | num_redirects_so_far, |
HttpRequest * | request | ||
) | const [virtual] |
Handles HTTP redirects (HTTP 3xx series results).
[in] | num_redirects_so_far | Number of redirects already followed. |
[in] | request | The request that caused the error. |
virtual bool HandleTransportError | ( | int | num_retries_so_far, |
HttpRequest * | request | ||
) | const [virtual] |
Handles transport errors.
[in] | num_retries_so_far | Number of retries performed already. |
[in] | request | The request that caused the error. |
void ResetHttpCodeHandler | ( | int | code, |
HttpCodeHandler * | handler | ||
) |
Replaces the existing handler for a given HTTP status code.
[in] | code | The HTTP status code to handle. |
[in] | handler | The handler to use can be NULL to remove it. Ownership is passed. non-NULL handlers must be a repeatable callback since it can be alled multiple times. |