Commit ec438a3b by zhengqiuyun86

异常调整

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