Documentation ¶
Overview ¶
Package errors contains internal types for the retry set of packages.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrRetryCanceled is an error that is returned when a retry is canceled. This is substituted for a context.Canceled // or context.DeadlineExceeded error to differentiate between a retry being cancelled and the last error from the Op being // context.Canceled or context.DeadlineExceeded. ErrRetryCanceled = errors.New("retry canceled") // ErrPermanent is an error that is permanent and cannot be retried. This // is similar to errors.ErrUnsupported in that it shouldn't be used directly, but instead // wrapped in another error. You can determine if you have a permanent error with // Is(err, ErrPermanent). ErrPermanent = errors.New("permanent error") )
Functions ¶
Types ¶
type ErrRetryAfter ¶
type ErrRetryAfter struct { // Time after which the call can be retried. Time time.Time // The error that can be retried. Err error }
ErrRetryAfter can be used to wrap an error to indicate that the error can be retried after a certain time. This is useful when a remote service returns a retry interval in the response and you want to carry the signal to your retry logic. This error should not be returned to the caller of Retry(). DO NOT use this as &ErrRetryAfter{}, simply ErrRetryAfter{} or it won't work.'
Click to show internal directories.
Click to hide internal directories.