errorsutil

package
v0.63.11 Latest Latest
Warning

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

Go to latest
Published: May 11, 2024 License: MIT Imports: 3 Imported by: 71

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrIndexOutOfRange added in v0.40.4

func ErrIndexOutOfRange(idx, len int) error

ErrIndexOutOfRange returns an `error` using the standard message for index out of range.

func ErrorsToStrings

func ErrorsToStrings(errs []error) (int, []string)

ErrorsToStrings returns a slice of strings. A count of non-nil errors is also returned.

func Join

func Join(inclNils bool, errs ...error) error

func NilifyIs added in v0.51.0

func NilifyIs(err error, errs ...error) error

NilifyIs will return a `nil` for if the supplied `err` `errors.Is() any of the errors in `errs`.`

func PanicOnErr

func PanicOnErr(err error)

PanicOnErr is a syntactic sugar function to panic on error.

func Wrap added in v0.33.8

func Wrap(err error, wrap ...string) error

Wrap wraps an error with the supplied strings.

func Wrapf added in v0.41.7

func Wrapf(origErr error, wrapFormat string, wrapVars ...any) error

Wrapf will wrap the error, first performing a `fmt.Sprintf()` on the supplied params.

Types

type ErrorInfo

type ErrorInfo struct {
	Error       error
	ErrorString string // must match Error
	Code        string
	Summary     string
	Description string
	Explanation string
	Source      string
	Input       string
	Correct     string
}

type ErrorInfos

type ErrorInfos []*ErrorInfo

func (ErrorInfos) ErrorsString

func (eis ErrorInfos) ErrorsString() []string

func (ErrorInfos) Filter

func (eis ErrorInfos) Filter(isError bool) ErrorInfos

func (ErrorInfos) GoodCorrects

func (eis ErrorInfos) GoodCorrects() []string

func (ErrorInfos) GoodInputs

func (eis ErrorInfos) GoodInputs() []string

func (ErrorInfos) Inflate

func (eis ErrorInfos) Inflate()

Jump to

Keyboard shortcuts

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