errors

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2019 License: MIT Imports: 12 Imported by: 14

README

errors

error handle for go

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cfg = struct {
	Debug bool
}{
	Debug: false,
}
View Source
var ErrTag = struct {
	UnknownErr string
}{
	UnknownErr: "unknown",
}

Functions

func Debug

func Debug()

func ErrHandle

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

func FnCost

func FnCost(f func()) time.Duration

func FnOf

func FnOf(fn interface{}, args ...interface{}) func() []reflect.Value

func Handle

func Handle(fn ...func(m *M))

func If

func If(b bool, t, f interface{}) interface{}

func IsNil

func IsNil(p interface{}) (b bool)

func P

func P(d ...interface{})

func Panic

func Panic(err error)

func Resp

func Resp(fn func(err *Err))

func T

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

func TT

func TT(b bool, fn func(m *M))

func Try

func Try(fn interface{}, cfn ...interface{}) (err error)

func Wrap

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

func WrapM

func WrapM(err error, fn func(m *M))

Types

type Err

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

func (*Err) Err

func (t *Err) Err() error

func (*Err) Error

func (t *Err) Error() string

func (*Err) P

func (t *Err) P()

func (*Err) StackTrace

func (t *Err) StackTrace() *_Err

func (*Err) Tag

func (t *Err) Tag() string

type M

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

func (*M) Caller

func (t *M) Caller(depth int) *M

func (*M) M

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

func (*M) Msg

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

func (*M) Tag

func (t *M) Tag(tag string) *M

Jump to

Keyboard shortcuts

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