Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1593 from jokly/error-handler
Browse files Browse the repository at this point in the history
Add WithErrorHandler client option
  • Loading branch information
svanharmelen authored Dec 12, 2022
2 parents 837fee3 + db9dda5 commit 65b39a6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions client_options.go
Original file line number Diff line number Diff line change
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 65b39a6

Please sign in to comment.