mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-01-23 02:40:23 +08:00
logic返回有错误代码时,标记为错误日志
This commit is contained in:
parent
516b3f3708
commit
4a99df6416
@ -101,10 +101,14 @@ func responseJson(r *ghttp.Request) {
|
||||
|
||||
if err = r.GetError(); err != nil {
|
||||
// 记录到自定义错误日志文件
|
||||
g.Log().Stdout(false).Printf(ctx, "exception:%v", err)
|
||||
|
||||
code = gerror.Code(err).Code()
|
||||
|
||||
if code == gcode.CodeNil.Code() {
|
||||
g.Log().Stdout(false).Printf(ctx, "exception:%v", err)
|
||||
} else {
|
||||
g.Log().Errorf(ctx, "exception:%v", err)
|
||||
}
|
||||
|
||||
// 是否输出错误到页面
|
||||
if g.Cfg().MustGet(ctx, "hotgo.debug", true).Bool() {
|
||||
message = gerror.Current(err).Error()
|
||||
|
Loading…
Reference in New Issue
Block a user