errors

package
v0.28.20240402154002 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: MIT Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSimplifyFunc = func(e error) string {
		return e.Error() + "\n"
	}
	ErrInLineFunc = func(e error) string {
		return " > " + e.Error()
	}
)

Functions

func Catch

func Catch(e error, action string) bool

func ErrorFormat added in v0.28.20240114140844

func ErrorFormat(e error, format ...func(error) string) (s string)

func Join added in v0.28.20240114140844

func Join(e ...error) error

func Unwrap added in v0.28.20240114140844

func Unwrap(e error) []error

Types

type Error

type Error struct {
	Reason string
	// contains filtered or unexported fields
}

func Grow

func Grow(e error, son Error) Error

Grow will overwrite reason but save action for catch

func New

func New(action string, reason ...string) (e Error)

func (Error) Error

func (t Error) Error() string

func (Error) WithReason added in v0.28.20240325172911

func (t Error) WithReason(reason string) Error

Jump to

Keyboard shortcuts

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