errors

package
v0.0.0-...-ffcb421 Latest Latest
Warning

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

Go to latest
Published: May 12, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Errorf = fmt.Errorf
View Source
var WrapAndTrace = WrapAndTraceInMsg

Functions

func CombineByString

func CombineByString(err error) error

if multi err, combine similar errors

func ErrorContains

func ErrorContains(err error, substr string) bool

func ErrorContainsAny

func ErrorContainsAny(err error, substrs ...string) bool

func Flatten

func Flatten(err error) []error

flattens error tree

func HandleErrDefer

func HandleErrDefer(f func() error)

func IsAny

func IsAny(err error, errs ...error) bool

func IsErrorExcept

func IsErrorExcept(err error, errs ...error) bool

func IsErrorExceptSubstr

func IsErrorExceptSubstr(err error, substr ...string) bool

func Join

func Join(errs ...error) error

func Root

func Root(err error) error

func Roots

func Roots(errs []error) error

func TruncateErrorForLogging

func TruncateErrorForLogging(err error, maxLength int) error

TruncateErrorForLogging truncates a long error message to a more manageable size while preserving the most important parts of the error message

func Unwraps

func Unwraps(err error) []error

func Wrap

func Wrap(err error, msg string) error

func WrapAndTrace2

func WrapAndTrace2[T any](t T, err error) (T, error)

func WrapAndTraceInMsg

func WrapAndTraceInMsg(err error) error

Types

type ValidationError

type ValidationError struct {
	Message string
}

func NewValidationError

func NewValidationError(message string) ValidationError

func (ValidationError) Error

func (v ValidationError) Error() string

Jump to

Keyboard shortcuts

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