Documentation ¶
Index ¶
- Variables
- func Exit(err error)
- func ExitErr(_ interface{}, err error)
- func ExitF(err error, msg string, args ...interface{})
- func New(code int, Msg string) interface{ ... }
- func Panic(err error)
- func PanicBytes(d1 []byte, err error) []byte
- func PanicErr(d1 interface{}, err error) interface{}
- func PanicF(err error, msg string, args ...interface{})
- func PanicFile(d1 *os.File, err error) *os.File
- func PanicResponse(d1 *http.Response, err error) *http.Response
- func PanicStr(d1 string, err error) string
- func Resp(f func(err XErr))
- func RespErr(err *error)
- func Wrap(err error) error
- func WrapF(err error, msg string, args ...interface{}) error
- type Frame
- type XErr
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrDone done ErrDone = errors.New("DONE") ErrBadRequest = New(400, http.StatusText(400)) ErrForbidden = New(403, http.StatusText(403)) ErrNotFound = New(404, http.StatusText(404)) ErrMethodNotAllowed = New(405, http.StatusText(405)) ErrTimeout = New(408, http.StatusText(408)) ErrConflict = New(409, http.StatusText(409)) ErrInternalServerError = New(500, http.StatusText(500)) Debug bool )
View Source
var ( UnWrap = errors.Unwrap Is = errors.Is As = func(err error, target interface{}) bool { if target == nil { return false } val := reflect.ValueOf(target) typ := val.Type() if typ.Kind() != reflect.Ptr || val.IsNil() { return false } if e := typ.Elem(); e.Kind() != reflect.Interface && !typ.Implements(errorType) { return false } targetType := typ.Elem() for err != nil { if reflect.TypeOf(err).AssignableTo(targetType) { val.Elem().Set(reflect.ValueOf(err)) return true } if x, ok := err.(interface{ As(interface{}) bool }); ok && x.As(target) { return true } err = UnWrap(err) } return false } )
ext from errors
Functions ¶
func PanicBytes ¶ added in v0.2.39
func PanicResponse ¶ added in v0.2.52
Types ¶
Click to show internal directories.
Click to hide internal directories.