Skip to content

Commit

Permalink
update error code to 500
Browse files Browse the repository at this point in the history
  • Loading branch information
varungup90 committed Sep 26, 2024
1 parent a89b216 commit 95b5d74
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/users/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func (s *httpServer) createUser(w http.ResponseWriter, r *http.Request) {
}

if err := utils.SetUser(u, s.redisClient); err != nil {
fmt.Fprintf(w, "error occurred on creating user: %+v", err)
http.Error(w, fmt.Sprintf("error occurred on creating user: %+v", err), http.StatusInternalServerError)
return
}

Expand Down Expand Up @@ -120,7 +120,7 @@ func (s *httpServer) updateUser(w http.ResponseWriter, r *http.Request) {
}

if err := utils.SetUser(u, s.redisClient); err != nil {
fmt.Fprintf(w, "error occurred on updating user: %+v", err)
http.Error(w, fmt.Sprintf("error occurred on updating user: %+v", err), http.StatusInternalServerError)
return
}

Expand Down Expand Up @@ -148,7 +148,7 @@ func (s *httpServer) deleteUser(w http.ResponseWriter, r *http.Request) {
}

if err := utils.DelUser(u, s.redisClient); err != nil {
fmt.Fprintf(w, "error occurred on deleting user: %+v", err)
http.Error(w, fmt.Sprintf("error occurred on deleting user: %+v", err), http.StatusInternalServerError)
return
}

Expand Down

0 comments on commit 95b5d74

Please sign in to comment.