3 Star 17 Fork 4

eyebluecn/tank

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
bean.go 573 Bytes
Copy Edit Raw Blame History
Zicla authored 2018-07-03 13:45 +08:00 . Add the file downloader.
package rest
import "net/http"
type IBean interface {
Init(context *Context)
PanicError(err error);
PanicWebError(msg string, code int);
}
type Bean struct {
context *Context
}
func (this *Bean) Init(context *Context) {
this.context = context
}
//处理错误的统一方法
func (this *Bean) PanicError(err error) {
if err != nil {
panic(&WebError{Msg: err.Error(), Code: http.StatusInternalServerError})
}
}
//处理错误的统一方法
func (this *Bean) PanicWebError(msg string, httpStatusCode int) {
panic(&WebError{Msg: msg, Code: httpStatusCode})
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/eyebluecn/tank.git
git@gitee.com:eyebluecn/tank.git
eyebluecn
tank
tank
v1.0.5

Search