errorsutil

package
v0.41.7 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2022 License: MIT Imports: 3 Imported by: 73

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)

func Join

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

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(origErr error, wrapPrefix string) error

func Wrapf added in v0.41.7

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

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