fix: 修复 resp RE 返回时 error 问题

This commit is contained in:
zhaoyupeng
2025-07-23 10:32:47 +08:00
parent bb5dd2583d
commit 61a115852e

View File

@ -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)
}