Documentation ¶
Overview ¶
Package errcode 错误处理包
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInternal = errors.New("服务器内部错误") ErrAuthCheckToken = errors.New("解析TOKEN失败") )
View Source
var ( ErrTooManyRequest = errors.New("服务器繁忙") ErrAuthCheckTokenTimeOut = errors.New("TOKEN过期") ErrAuth = errors.New("TOKEN错误") ErrPermissionDenied = errors.New("权限不足") ErrParamTypeError = errors.New("参数错误") ErrUsernameHadBeenRegistered = errors.New("用户名已被注册") ErrLoginFail = errors.New("登录失败") )
Functions ¶
This section is empty.
Types ¶
type Coder ¶
type Coder interface { // HTTPStatus HTTP status that should be used for the associated error code. HTTPStatus() int // Code returns the code of the coder Code() int // String External (user) facing error text. String() string // Error 返回error Error() error }
func ParseCoder ¶
ParseCoder parse any error into *withCode. nil error will return nil direct. None withStack error will be parsed as ErrUnknown.
Click to show internal directories.
Click to hide internal directories.