完成关于异常的定义与处理
This commit is contained in:
26
abstrace.go
Normal file
26
abstrace.go
Normal file
@ -0,0 +1,26 @@
|
||||
// Package exception ...
|
||||
//
|
||||
// Description : exception ...
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 2022-06-25 21:11
|
||||
package exception
|
||||
|
||||
// IException 异常的接口定义
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date *: 21:05 2022/6/25
|
||||
type IException interface {
|
||||
// Error 兼容 go 内置 error
|
||||
Error() string
|
||||
// GetCode *获取错误码
|
||||
GetCode() interface{}
|
||||
// GetMessage *获取错误信息
|
||||
GetMessage() string
|
||||
// GetData 获取异常时的返回数据
|
||||
GetData() map[string]interface{}
|
||||
// GetHttpCode *获取当前异常要返回的http状态码, 不设置则 默认 200
|
||||
GetHttpCode() int
|
||||
}
|
Reference in New Issue
Block a user