Commit 55310da5 by 孙龙

up

parent b0140f98
Showing with 5 additions and 7 deletions
......@@ -4,10 +4,8 @@ import (
"errors"
"fmt"
"github.com/gin-gonic/gin"
common "golang-callback/app/common/function"
"golang-callback/util"
"github.com/ichunt2019/cfg/lib"
"runtime/debug"
common "golang-callback/app/common/function"
)
// RecoveryMiddleware捕获所有panic,并且返回错误信息
......@@ -18,10 +16,10 @@ func RecoveryMiddleware() gin.HandlerFunc {
if err := recover(); err != nil {
//先做一下日志记录
//fmt.Println(string(debug.Stack()))
util.ComLogNotice(c, "_com_panic", map[string]interface{}{
"error": fmt.Sprint(err),
"stack": string(debug.Stack()),
})
//util.ComLogNotice(c, "_com_panic", map[string]interface{}{
// "error": fmt.Sprint(err),
// "stack": string(debug.Stack()),
//})
if lib.Instance("proxy").GetString("base.debug_mode") != "debug" {
//ResponseError(c, 500, errors.New("内部错误"))
common.Output(c,500,"内部错误",nil)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment