fix: 修复 resp RE 返回时 error 问题
This commit is contained in:
10
resp/resp.go
10
resp/resp.go
@ -68,11 +68,7 @@ H4:
|
||||
r.Code = code
|
||||
}
|
||||
H3:
|
||||
if es, ok := args[2].(error); ok {
|
||||
r.Err = es.Error()
|
||||
} else {
|
||||
r.Err = args[2]
|
||||
}
|
||||
r.Err = args[2]
|
||||
H2:
|
||||
r.Data = args[1]
|
||||
H1:
|
||||
@ -86,6 +82,10 @@ END:
|
||||
r.Msg = Msg(r.Status)
|
||||
}
|
||||
|
||||
if ce, ok := r.Err.(error); ok {
|
||||
r.Err = ce.Error()
|
||||
}
|
||||
|
||||
c.AbortWithStatusJSON(r.Status, r)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user