mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-08-28 10:09:54 +08:00
优化非debug模式用户不可见错误提示
This commit is contained in:
@@ -104,11 +104,13 @@ func responseJson(r *ghttp.Request) {
|
||||
g.Log().Warningf(ctx, "exception:%v", err)
|
||||
|
||||
code = gerror.Code(err).Code()
|
||||
message = err.Error()
|
||||
|
||||
// 是否输出错误到页面
|
||||
if g.Cfg().MustGet(ctx, "hotgo.debug", true).Bool() {
|
||||
message = err.Error()
|
||||
data = charset.ParseErrStack(err)
|
||||
} else {
|
||||
message = consts.ErrorMessage(err)
|
||||
}
|
||||
} else {
|
||||
data = r.GetHandlerResponse()
|
||||
|
Reference in New Issue
Block a user