Skip to content

Commit

Permalink
Add WithErrorHandler client option
Browse files Browse the repository at this point in the history
  • Loading branch information
jokly committed Dec 12, 2022
1 parent ac5896f commit db9dda5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions client_options.go
Expand Up @@ -94,6 +94,14 @@ func WithCustomRetryWaitMinMax(waitMin, waitMax time.Duration) ClientOptionFunc
}
}

// WithErrorHandler can be used to configure a custom error handler.
func WithErrorHandler(handler retryablehttp.ErrorHandler) ClientOptionFunc {
return func(c *Client) error {
c.client.ErrorHandler = handler
return nil
}
}

// WithHTTPClient can be used to configure a custom HTTP client.
func WithHTTPClient(httpClient *http.Client) ClientOptionFunc {
return func(c *Client) error {
Expand Down

0 comments on commit db9dda5

Please sign in to comment.