// retryHTTPCheck provides a callback for Client.CheckRetry which
// will retry both rate limit (429) and server (>= 500) errors.
retryHTTPCheck provides a callback for Client.CheckRetry which
will retry both rate limit (429) and server (>= 500) errors.
// retryHTTPCheck provides a callback for Client . CheckRetry which // will retry both rate limit ( 429 ) and server ( > = 500 ) errors .
func (c *Client) retryHTTPCheck(ctx context.Context, resp *http.Response, err error) (bool, error) {
	if ctx.Err() != nil {
		return false, ctx.Err()
	}
	if err != nil {
		return c.retryServerErrors, err
	}
	if resp.StatusCode == 429 || (c.retryServerErrors && resp.StatusCode >= 500) {
		return true, nil
	}
	return false, nil
}
func ( c * Client ) retryHTTPCheck ( ctx context . Context , resp * http . Response , err error ) ( bool , error ) { if ctx . Err ( ) != nil { return false , ctx . Err ( ) } if err != nil { return c . retryServerErrors , err } if resp . StatusCode == 429 || ( c . retryServerErrors && resp . StatusCode >= 500 ) { return true , nil } return false , nil }
retryHTTPCheck provides a callback for Client.CheckRetry which
will retry both rate limit (429) and server (>= 500) errors.
retryHTTPCheck provides a callback for Client . CheckRetry which will retry both rate limit ( 429 ) and server ( > = 500 ) errors .