Refactor error handling in system and trace controllers
- Updated error response codes for various validation errors from 400 to 422 to better reflect the nature of the errors. - Changed error messages for empty parameters (e.g., userId, menuId, roleId) to use a consistent error code format. - Improved error handling in the IPerf, Ping, and WS controllers to provide more informative error messages. - Ensured that all controllers return appropriate error messages when binding JSON or query parameters fails.
This commit is contained in:
@@ -60,7 +60,7 @@ func RepeatSubmit(interval int64) gin.HandlerFunc {
|
||||
|
||||
// 小于间隔时间且参数内容一致
|
||||
if compareTime < interval && compareParams {
|
||||
c.JSON(200, resp.ErrMsg("不允许重复提交,请稍候再试"))
|
||||
c.JSON(200, resp.ErrMsg("repeat submissions are not allowed. Please try again later."))
|
||||
c.Abort()
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user