retryableerror

package
v1.30.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 31, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMaybeRetryableAggregate

func NewMaybeRetryableAggregate(errs []error) error

NewMaybeRetryableAggregate converts a slice of errors into a single error value. Nil values will be filtered from the slice. If the filtered slice is empty, the return value will be nil. Else, if any values are non-retryable errors, the result will be an Aggregate interface. Else, if all errors are retryable, the result will be a retryable Error interface, with After() equal to the minimum of all the errors' After() values.

Types

type Error

type Error interface {
	error
	// After is the time period after which the operation that caused the
	// error should be retried.
	After() time.Duration
}

Error represents an error for an operation that should be retried after the specified duration.

func New

func New(err error, after time.Duration) Error

New returns a new RetryableError with the given error and time period.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL