Ver Fonte

debug: логируем validation error в production

neyrogovnarik há 1 mês atrás
pai
commit
83a2d7cead
1 ficheiros alterados com 1 adições e 0 exclusões
  1. 1 0
      backend/internal/handlers/errors.go

+ 1 - 0
backend/internal/handlers/errors.go

@@ -39,6 +39,7 @@ func writeError(w http.ResponseWriter, status int, msg string, err error) {
 func writeValidationError(w http.ResponseWriter, err error) {
 	details := err.Error()
 	if AppEnv == "production" {
+		slog.Error("validation error", "error", details)
 		details = "validation failed"
 	}
 	writeJSON(w, http.StatusUnprocessableEntity, map[string]interface{}{