feat: 优化errorCode报错

This commit is contained in:
余泓铮
2025-06-30 18:10:19 +08:00
parent 9e4d862fcb
commit 364bf0172d

View File

@@ -131,7 +131,7 @@ func RenderSuccess(c *gin.Context, result interface{}) {
func RenderError(c *gin.Context, err error) {
log.Error().Err(err).Msgf("failed to %s", c.HandlerName())
c.JSON(http.StatusOK,
c.JSON(http.StatusInternalServerError,
HttpResponse{
Code: code.GetErrorCode(err),
Message: "grey " + err.Error(),
@@ -146,7 +146,7 @@ func RenderErrorInitDriver(c *gin.Context, err error) {
if errCode == code.GeneralFail {
errCode = code.GetErrorCode(code.MobileUIDriverError)
}
c.JSON(http.StatusOK,
c.JSON(http.StatusInternalServerError,
HttpResponse{
Code: errCode,
Message: "grey init driver failed",