locale
This commit is contained in:
@@ -39,12 +39,12 @@ func HandleValidationError(c *gin.Context, err error) {
|
|||||||
func HandleUserUpdateError(c *gin.Context, err error) {
|
func HandleUserUpdateError(c *gin.Context, err error) {
|
||||||
switch err {
|
switch err {
|
||||||
case errors.ErrUserNotFound:
|
case errors.ErrUserNotFound:
|
||||||
RespondWithError(c, err, "Error while updating user", http.StatusNotFound, "user", "server.validation.user_not_found")
|
RespondWithError(c, err, "Error while updating user", http.StatusNotFound, "user.user", "server.validation.user_not_found")
|
||||||
case errors.ErrInvalidUserData:
|
case errors.ErrInvalidUserData:
|
||||||
RespondWithError(c, err, "Error while updating user", http.StatusBadRequest, "user", "server.validation.invalid_user_data")
|
RespondWithError(c, err, "Error while updating user", http.StatusBadRequest, "user.user", "server.validation.invalid_user_data")
|
||||||
case errors.ErrSubscriptionNotFound:
|
case errors.ErrSubscriptionNotFound:
|
||||||
RespondWithError(c, err, "Error while updating user", http.StatusBadRequest, "subscription", "server.validation.subscription_data")
|
RespondWithError(c, err, "Error while updating user", http.StatusBadRequest, "subscription", "server.validation.subscription_data")
|
||||||
default:
|
default:
|
||||||
RespondWithError(c, err, "Error while updating user", http.StatusInternalServerError, "user", "server.error.internal_server_error")
|
RespondWithError(c, err, "Error while updating user", http.StatusInternalServerError, "user.user", "server.error.internal_server_error")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user