xerror

package
v0.2.30 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDone = errors.New("xerror.done")

	ErrUnknownType = _XErr.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{})

func ErrHandle

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

ErrHandle errors

func Exit added in v0.1.27

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

Exit os exit when panic

func ExitErr added in v0.2.18

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

ExitErr exit when panic else return value

func P added in v0.2.14

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

P

func Panic

func Panic(err interface{})

Panic

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 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
	StackTrace() *_Err1
	// contains filtered or unexported methods
}

type XErr added in v0.2.10

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

func NewXErr added in v0.2.10

func NewXErr(name string) XErr

func (XErr) Err added in v0.2.10

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

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

func (XErr) New added in v0.2.10

func (t XErr) New(format string) XErr

func (XErr) Wrap added in v0.2.12

func (t XErr) Wrap(err error) error

Jump to

Keyboard shortcuts

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