xerror

package
v0.2.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Errs = struct {
	Done        error
	UnknownType error
	HasExisted  error
}{
	Done:        errors.New("xerror.done"),
	UnknownType: errors.New("xerror.unknown_type"),
	HasExisted:  errors.New("xerror.registry_is_existed"),
}

Errs err tags

View Source
var SkipErrorFile = true

SkipErrorFile 是否跳过错误文件

Functions

func Assert

func Assert()

Assert errors

func AssertFn

func AssertFn(fn reflect.Value) error

AssertFn errors

func Debug

func Debug()

Debug errors

func ErrHandle

func ErrHandle(err interface{}, fn ...func(err *Err))

ErrHandle errors

func ErrsGet added in v0.2.0

func ErrsGet() map[error]bool

ErrsGet get error tags

func ErrsMatch added in v0.2.0

func ErrsMatch(tag error) bool

ErrsMatch check error tags

func ErrsRegister added in v0.2.0

func ErrsRegister(errs ...interface{})

ErrsRegister register

func Exit added in v0.1.27

func Exit(err interface{}) (fn func(...interface{}))

Exit os exit when panic

func New added in v0.1.32

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

New new error

func Panic

func Panic(err interface{})

Panic bool assert

func PanicErr

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

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

func PanicM

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

PanicM error assert

func PanicMM

func PanicMM(err interface{}, fn func(err *Err))

PanicMM error assert

func PanicT

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

PanicT error assert

func PanicTT

func PanicTT(b bool, fn func(err *Err))

PanicTT bool assert

func Resp

func Resp(fn func(err *Err))

Resp errors

func RespErr

func RespErr(err *error)

RespErr errors

func Wrap

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

Wrap error wrap

func WrapM

func WrapM(err interface{}, fn func(err *Err)) error

WrapM error wrap

Types

type Err

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

Err errors

func (*Err) Caller

func (t *Err) Caller(caller string)

Caller errors

func (*Err) Err

func (t *Err) Err() error

Err errors

func (*Err) Error

func (t *Err) Error() string

func (*Err) Is added in v0.1.43

func (t *Err) Is(err error) bool

func (*Err) M

func (t *Err) M(k string, v interface{})

M errors

func (*Err) Msg

func (t *Err) Msg(msg string, args ...interface{})

Msg errors

func (*Err) P

func (t *Err) P() string

P errors

func (*Err) StackTrace

func (t *Err) StackTrace() map[string]interface{}

StackTrace errors

Jump to

Keyboard shortcuts

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