xerror

package
v0.2.48 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrDone done
	ErrDone = errors.New("xerror.done")
	// Err base error
	Err = NewXErr("XErr")
	// ErrUnknownType error
	ErrUnknownType = Err.New("UnknownType")
)

Functions

func Assert

func Assert()

Assert errors

func AssertFn

func AssertFn(fn reflect.Value) error

AssertFn errors

func Debug

func Debug(d ...interface{})

Debug err

func ErrHandle

func ErrHandle(err interface{}, fn ...func(err IErr))

ErrHandle errors

func Exit added in v0.1.27

func Exit(err interface{})

func ExitErr added in v0.2.18

func ExitErr(d1 interface{}, err error) interface{}

ExitErr exit when panic else return value

func ExitF added in v0.2.47

func ExitF(err interface{}, msg interface{}, args ...interface{})

Exit os exit when panic

func P added in v0.2.14

func P(err error, msg string, args ...interface{})

P err

func Panic

func Panic(err interface{})

Panic panic

func PanicBytes added in v0.2.39

func PanicBytes(d1 interface{}, err error) []byte

func PanicErr

func PanicErr(d1 interface{}, err error) interface{}

PanicErr panic with func()(interface{},error)

func PanicM

func PanicM(err interface{}, msg interface{}, args ...interface{})

PanicM error assert

func PanicMM

func PanicMM(err interface{}, fn func(err IErr))

PanicMM error assert

func PanicStr added in v0.2.39

func PanicStr(d1 interface{}, err error) string

func PanicT

func PanicT(b bool, msg interface{}, args ...interface{})

PanicT bool assert

func PanicTT

func PanicTT(b bool, fn func(err IErr))

PanicTT bool assert

func Resp

func Resp(fn func(err IErr))

Resp errors

func RespErr

func RespErr(err *error)

RespErr errors

func Wrap

func Wrap(err interface{}, msg interface{}, args ...interface{}) error

Wrap error wrap

func WrapM

func WrapM(err interface{}, fn func(err IErr)) error

WrapM error wrap

Types

type IErr added in v0.2.10

type IErr interface {
	error

	P()
	M(k string, v interface{})
	Caller(caller ...string)
	Err() error
	SetErr(err interface{}, args ...interface{})
	Is(err error) bool
	As(err error) bool
	StackTrace() *_Err1
	// contains filtered or unexported methods
}

IErr err interface

type XErr added in v0.2.10

type XErr struct {
	// contains filtered or unexported fields
}

XErr struct

func NewXErr added in v0.2.10

func NewXErr(name string) XErr

NewXErr xerr

func (XErr) Err added in v0.2.10

func (t XErr) Err(format string, args ...interface{}) error

Err err

func (XErr) Error added in v0.2.10

func (t XErr) Error() string

func (XErr) Msg added in v0.2.10

func (t XErr) Msg(format string, args ...interface{}) string

Msg xerr

func (XErr) New added in v0.2.10

func (t XErr) New(format string) XErr

New xerr

func (XErr) Wrap added in v0.2.12

func (t XErr) Wrap(err error) error

Wrap xerr

Jump to

Keyboard shortcuts

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