errors

package
v0.0.0-...-ccdf309 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func As

func As(err error, target interface{}) bool

func Cause

func Cause(err error) error

func CauseWithNil

func CauseWithNil(err error) error

CauseWithNil returns Cause of an error. If error returned by Cause is same (no Causer interface implemented), function will return nil instead

func Errorf

func Errorf(format string, args ...interface{}) error

func Errors

func Errors(errs ...error) error

func ExecuteWithErrorArrayP2

func ExecuteWithErrorArrayP2[IN, P1, P2 any](caller WithErrorArrayP2[IN, P1, P2], p1 P1, p2 P2, elements ...IN) error

func Is

func Is(err, target error) bool

func IsConnectionRefused

func IsConnectionRefused(err error) bool

IsConnectionRefused returns true if the given error is caused by an "connection refused" error.

func IsConnectionReset

func IsConnectionReset(err error) bool

IsConnectionReset returns true if the given error is caused by an "connection reset by peer" error.

func IsContextCanceled

func IsContextCanceled(err error) bool

IsContextCanceled returns true if the given error is caused by a context cancelation.

func IsContextCanceledOrExpired

func IsContextCanceledOrExpired(err error) bool

IsContextCanceledOrExpired returns true if the given error is caused by a context cancelation or deadline expiration.

func IsContextDeadlineExpired

func IsContextDeadlineExpired(err error) bool

IsContextDeadlineExpired returns true if the given error is caused by a context deadline expiration.

func IsEOF

func IsEOF(err error) bool

IsEOF returns true if the given error is caused by an EOF error.

func IsReconcile

func IsReconcile(err error) bool

func IsTemporary

func IsTemporary(err error) bool

IsTemporary returns true if the given error is caused by a temporary error.

func IsTimeout

func IsTimeout(err error) bool

IsTimeout returns true if the given error is caused by a timeout error.

func New

func New(message string) error

func Reconcile

func Reconcile() error

func Section

func Section(cause error, format string, args ...interface{}) error

func WithMessage

func WithMessage(err error, message string) error

func WithMessagef

func WithMessagef(err error, format string, args ...interface{}) error

func WithStack

func WithStack(err error) error

func Wrap

func Wrap(err error, message string) error

func Wrapf

func Wrapf(err error, format string, args ...interface{}) error

Types

type Array

type Array []error

func (Array) Error

func (a Array) Error() string

type Causer

type Causer interface {
	Cause() error
}

type WithErrorArrayP2

type WithErrorArrayP2[IN, P1, P2 any] func(p1 P1, p2 P2, in IN) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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