完成关于异常的定义与处理

This commit is contained in:
2022-06-25 21:40:09 +08:00
parent 8133dee472
commit 03c01d829d
10 changed files with 351 additions and 0 deletions

26
abstrace.go Normal file
View 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
}