Improved error logging
This commit is contained in:
@ -15,7 +15,7 @@ func Edit(ctx *aero.Context) string {
|
||||
user := utils.GetUser(ctx)
|
||||
|
||||
if user == nil || user.Role != "admin" {
|
||||
return ctx.Error(http.StatusUnauthorized, "Not logged in or not auhorized to edit this user", nil)
|
||||
return ctx.Error(http.StatusUnauthorized, "Not logged in or not auhorized to edit this user")
|
||||
}
|
||||
|
||||
viewUser, err := arn.GetUserByNick(nick)
|
||||
|
@ -13,11 +13,11 @@ func Get(ctx *aero.Context) string {
|
||||
user := utils.GetUser(ctx)
|
||||
|
||||
if user == nil {
|
||||
return ctx.Error(http.StatusBadRequest, "Not logged in", nil)
|
||||
return ctx.Error(http.StatusBadRequest, "Not logged in")
|
||||
}
|
||||
|
||||
if user.Nick == "" {
|
||||
return ctx.Error(http.StatusInternalServerError, "User did not set a nickname", nil)
|
||||
return ctx.Error(http.StatusInternalServerError, "User did not set a nickname")
|
||||
}
|
||||
|
||||
return profile.Profile(ctx, user)
|
||||
|
Reference in New Issue
Block a user