Commit ec438a3b by zhengqiuyun86

异常调整

parent 1e19ae5a
......@@ -16,18 +16,20 @@ func ExceptionCatch(c *gin.Context) {
case exception.DError:
e := (err).(exception.DError)
if c == nil {
log.Error(fmt.Sprintf("%s-%s", e.Code, e.Err))
log.Errorf("%s-%s", e.Code, e.Err)
} else {
getWay.FailAndMsg(c, e.Code, e.Err)
}
break
default:
log.Error(err)
e := (err).(error)
var buf [1024]byte
n := runtime.Stack(buf[:], true)
fmt.Println(string(buf[:]), n)
if c != nil {
getWay.FailAndMsg(c, "SYSTEM.ERROR", "系统繁忙,请稍后重试")
if c == nil {
log.Error(e.Error())
} else {
getWay.FailAndMsg(c, "SYSTEM.ERROR", e.Error())
}
break
}
......
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 to comment