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:
@@ -1,8 +1,10 @@
|
||||
package services
|
||||
|
||||
import "be.ems/src/framework/resp"
|
||||
|
||||
const (
|
||||
CODE_FAIL = 0
|
||||
CODE_SUCC = 1
|
||||
CODE_FAIL = resp.CODE_ERROR
|
||||
CODE_SUCC = resp.CODE_SUCCESS
|
||||
)
|
||||
|
||||
func ErrResp(msg string) map[string]any {
|
||||
|
||||
Reference in New Issue
Block a user