temperror

package
v0.44.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsPermanent

func IsPermanent(target error) bool

IsPermanent tests whether an error is not a *TransientError.

func IsTransient

func IsTransient(target error) bool

IsTransient tests whether an error is a *TransientError.

func NetworkConnectionError

func NetworkConnectionError(err error) (matched bool)

NetworkConnectionError tests an error to see whether it was caused by a network connection failing. Depending on context, the network operation could be retried.

func Wrap

func Wrap(err error) error

Wrap wraps the given error in a *TransientError.

Types

type TransientError

type TransientError struct {
	Err error
}

TransientError signals that the operation can be retried. This is the opposite to PermanentError in github.com/cenkalti/backoff/v4

func (*TransientError) Error

func (e *TransientError) Error() string

Error implements the error interface.

func (*TransientError) Is

func (e *TransientError) Is(target error) bool

Is performs a shallow comparison and is used by errors.Is.

func (*TransientError) Unwrap

func (e *TransientError) Unwrap() error

Unwrap provides access to the contained error.

Jump to

Keyboard shortcuts

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