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

Commit db9dda5

Browse files
committed
Add WithErrorHandler client option
1 parent ac5896f commit db9dda5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

client_options.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,14 @@ func WithCustomRetryWaitMinMax(waitMin, waitMax time.Duration) ClientOptionFunc
9494
}
9595
}
9696

97+
// WithErrorHandler can be used to configure a custom error handler.
98+
func WithErrorHandler(handler retryablehttp.ErrorHandler) ClientOptionFunc {
99+
return func(c *Client) error {
100+
c.client.ErrorHandler = handler
101+
return nil
102+
}
103+
}
104+
97105
// WithHTTPClient can be used to configure a custom HTTP client.
98106
func WithHTTPClient(httpClient *http.Client) ClientOptionFunc {
99107
return func(c *Client) error {

0 commit comments

Comments
 (0)