errors

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddErrDealer added in v0.1.3

func AddErrDealer(errDealer ...ErrDealer)

AddErrDealer 添加一个错误处理器

func CheckErr added in v0.1.3

func CheckErr(err interface{}, w http.ResponseWriter, r *http.Request, isDev bool)

CheckErr check panic err , match err and deal

func WriteErrInfo added in v0.1.3

func WriteErrInfo(err interface{}, stack []byte, w http.ResponseWriter)

WriteErrInfo 返回错误信息

Types

type Dealer added in v0.1.3

type Dealer interface {
	Deal(err interface{}, w http.ResponseWriter, r *http.Request)
}

Dealer 匹配后的处理

type DoobError added in v0.2.0

type DoobError struct {
	Err       error
	Desc      string
	HttpStaus int
}

DoobError doob 的错误

func (DoobError) Error added in v0.2.0

func (de DoobError) Error() string

Error 实现error

type ErrDealer added in v0.1.3

type ErrDealer interface {
	Matcher
	Dealer
}

ErrDealer 错误处理,包含匹配和处理

type Matcher added in v0.1.3

type Matcher interface {
	Match(err interface{}) bool
}

Matcher 是否匹配错误

type MehtodNotMatchError added in v0.2.0

type MehtodNotMatchError struct {
	RequestError
	Method string
}

MehtodNotMatchError 匹配错误

func (MehtodNotMatchError) Error added in v0.2.0

func (mnm MehtodNotMatchError) Error() string

Error 实现error

type RequestError added in v0.2.0

type RequestError struct {
	DoobError
	Url string
}

RequestError 请求错误

func (RequestError) Error added in v0.2.0

func (re RequestError) Error() string

Error 实现error

Jump to

Keyboard shortcuts

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