Documentation ¶
Index ¶
- func As(err error, target interface{}) bool
- func Cause(err error) error
- func Code(err error) code.Code
- func Is(err, target error) bool
- func New(text string) error
- func NewError(args ...interface{}) error
- func Next(err error) error
- func Replace(err error, text string, condition ...code.Code) error
- func Stack(err error) *stack.Stack
- func Unwrap(err error) error
- type Error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Error ¶
type Error interface { error // Is 返回当前错误是否等于目标错误 Is(target error) bool // As 返回当前错误是否是某一类错误 As(target interface{}) bool // Code 返回错误码 Code() code.Code // Next 返回下一个错误 Next() error // Cause 返回根因错误 Cause() error // Stack 返回堆栈 Stack() *stack.Stack // Replace 替换文本 Replace(text string, condition ...code.Code) error }
Click to show internal directories.
Click to hide internal directories.