errors

package
v0.0.0-...-3511abf Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StickyError

type StickyError struct {
	// contains filtered or unexported fields
}

StickyError is a helper struct that can be used to retry an error for a given number of retries and timeout.

func NewStickyError

func NewStickyError(timeout time.Duration, maxRetries int) *StickyError

NewStickyError returns a new ErrorTimeoutRetry.

func (*StickyError) Error

func (e *StickyError) Error() error

Error returns an error after max retries has been met and we are within the timeout duration.

func (*StickyError) SetError

func (e *StickyError) SetError(err error) error

SetError increments or resets the number of retries if the last error was within the timeout duration or the current error is nil. Returns the error provided by GetError.

Jump to

Keyboard shortcuts

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