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 9, 2022
1 parent ac5896f commit 858e600
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions client_options.go
Expand Up @@ -118,6 +118,14 @@ func WithResponseLogHook(hook retryablehttp.ResponseLogHook) 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
}
}

// WithoutRetries disables the default retry logic.
func WithoutRetries() ClientOptionFunc {
return func(c *Client) error {
Expand Down

0 comments on commit 858e600

Please sign in to comment.