Skip to content

Commit

Permalink
fix: log on sever errors returned to client
Browse files Browse the repository at this point in the history
  • Loading branch information
ybizeul committed Aug 23, 2023
1 parent cb20afc commit 62a525b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions internal/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ func GetSecret(r *http.Request) (string, bool) {
}

func CloseWithCodeAndMessage(w http.ResponseWriter, code int, message string) {
slog.Error(message, slog.Int("code", code))
w.WriteHeader(code)
w.Write([]byte(message))
}

0 comments on commit 62a525b

Please sign in to comment.