Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( NotFoundError = NewNotFound(0, "not found") DuplicatedError = NewDuplicated(0, "already exists") IllegalArgumentError = NewIllegalArgument(0, "illegal argument") )
Functions ¶
Types ¶
type CodeError ¶
type CodeError struct { Log string `json:"-"` // record log, not show for user Msg string `json:"msg"` Code int `json:"code"` }
CodeError 带错误码的错误
type ConstError ¶
type ConstError string
ConstError 不可变error
func (ConstError) Error ¶
func (e ConstError) Error() string
type Duplicated ¶
type Duplicated struct {
// contains filtered or unexported fields
}
Duplicated 重复
func (Duplicated) AddMsg ¶
func (e Duplicated) AddMsg(msgs ...string) Duplicated
func (Duplicated) Error ¶
func (e Duplicated) Error() string
type IllegalArgument ¶
type IllegalArgument struct {
// contains filtered or unexported fields
}
IllegalArgument 参数不合法
func NewIllegalArgument ¶
func NewIllegalArgument(code int, msgs ...string) IllegalArgument
NewIllegalArgument 新建
func (IllegalArgument) AddMsg ¶
func (e IllegalArgument) AddMsg(msgs ...string) IllegalArgument
func (IllegalArgument) Error ¶
func (e IllegalArgument) Error() string
type Unauthorized ¶
type Unauthorized struct {
// contains filtered or unexported fields
}
Unauthorized 权限错误
func (Unauthorized) AddMsg ¶
func (e Unauthorized) AddMsg(msgs ...string) Unauthorized
func (Unauthorized) Error ¶
func (e Unauthorized) Error() string
Click to show internal directories.
Click to hide internal directories.