Documentation ¶
Overview ¶
Package exp 定义 ngro 扩展的错误类型接口 与内置error的不同点
1、在于多提供错误代码 code,用于后续的帮助文档 2、通过原始 error,创建 exp 来包装原始错误
Index ¶
- Constants
- func CallStack(offset ...int) []string
- func IsExp(err error) bool
- type Exp
- func Code(code int, message string) Exp
- func CodeF(code int, format string, args ...interface{}) Exp
- func New(message string) Exp
- func NewF(format string, args ...interface{}) Exp
- func Wrap(cause error, code int, message string) Exp
- func WrapF(cause error, code int, format string, args ...interface{}) Exp
Constants ¶
View Source
const (
// DEFAULT_ERROR_CODE ��默认错误代码
DEFAULT_ERROR_CODE = 819
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Exp ¶
type Exp interface { // Error 继承原始 error 接口,方便转换到 error Error() string // Code 返回错误关联的错误代码 Code() int // Cause 返回引发错误的原始 error Cause() error }
Exp 描述 ngro 扩展的错误接口
Click to show internal directories.
Click to hide internal directories.