fix: rm HandleError ErrSuccess

This commit is contained in:
chris
2024-07-25 10:09:04 +08:00
parent e26cd176d9
commit 4a18f354b7

View File

@@ -28,7 +28,7 @@ func HandleError(ctx *gin.Context, httpCode int, err error, data interface{}) {
data = map[string]string{}
}
resp := Response{Code: errorCodeMap[err], Message: err.Error(), Data: data}
if _, ok := errorCodeMap[ErrSuccess]; !ok {
if _, ok := errorCodeMap[err]; !ok {
resp = Response{Code: 500, Message: "unknown error", Data: data}
}
ctx.JSON(httpCode, resp)