Documentation ¶
Index ¶
- func As(err, target error) bool
- func Assert(e error) bool
- func ErrorCodeF(code int, format string, args ...interface{}) error
- func ErrorF(format string, args ...interface{}) error
- func Is(err, target error) bool
- func New(s string, extras ...error) error
- func NewCode(code int, s string, extras ...error) error
- func ToArr(err error) []string
- func ToStr(err error) string
- func UnWrap(err error) error
- func WithCodeMessage(code int, err error, msg string, extras ...error) error
- func WithCodeMessageF(code int, err error, format string, args ...interface{}) error
- func WithCodeStack(code int, err error, extras ...error) error
- func WithMessage(err error, msg string, extras ...error) error
- func WithMessageF(err error, format string, args ...interface{}) error
- func WithStack(err error, extras ...error) error
- type StackError
- func (c *StackError) Code() int
- func (c *StackError) Err() error
- func (c *StackError) Error() string
- func (c *StackError) Errs() []error
- func (c *StackError) ExistExtra() bool
- func (c *StackError) Msg() string
- func (c *StackError) ToArr() []string
- func (c *StackError) ToStr() string
- func (c *StackError) ToStrByExtra() string
- type StackSourceEntity
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithCodeMessage ¶
错误+信息+额外errs
func WithCodeMessageF ¶
错误+格式+信息
Types ¶
type StackError ¶
type StackError struct {
// contains filtered or unexported fields
}
错误自定义, 支持堆栈信息的错误结构体
type StackSourceEntity ¶
type StackSourceEntity struct { File string `json:"file"` // 文件名称 LineCode string `json:"line"` // 行号 FuncName string `json:"func"` // 函数名称 }
定义输出的结构体
func MarshalStack ¶
func MarshalStack(err error) []*StackSourceEntity
MarshalStack implements pkg/errors stack trace marshaling.
Click to show internal directories.
Click to hide internal directories.