支持打印堆栈

This commit is contained in:
2024-09-30 16:13:43 +08:00
parent e8561a060c
commit 1e7f84ed84
4 changed files with 55 additions and 26 deletions

View File

@ -16,15 +16,17 @@ type IException interface {
// Error 兼容 go 内置 error
Error() string
// GetCode 获取错误码
GetCode() interface{}
GetCode() any
// GetMessage *获取错误信息
GetMessage() string
// GetData 获取异常时的返回数据
GetData() interface{}
GetData() any
// GetHttpCode 获取当前异常要返回的http状态码, 不设置则 默认 200
GetHttpCode() int
// ToError 转换为内置error类型
ToError() error
// IsCode 是否为指定code
IsCode(code interface{}) bool
IsCode(code any) bool
// GetStack 获取调用堆栈
GetStack() string
}