Documentation ¶
Overview ¶
Package xerror 错误处理( error ) 相关的功能,是对标准库 errors 的补充
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // NotFound 错误:数据找不到 NotFound = NewCodeError(1000, "not found") // InvalidStatus 错误:数据的状态非正常 InvalidStatus = NewCodeError(1001, "invalid status") // InvalidParam 错误:无效的请求参数 InvalidParam = NewCodeError(1002, "invalid param") )
Functions ¶
Types ¶
type HasErrCode ¶
type HasErrCode interface {
ErrCode() int64
}
type NotExistsError ¶
type NotExistsError interface {
NotExists() bool
}
type OnceSet ¶
type OnceSet struct {
// contains filtered or unexported fields
}
OnceSet 只允许设置一次的用于存储 error 信息的对象
type TraceError ¶
Click to show internal directories.
Click to hide internal directories.