Эх сурвалжийг харах

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

neyrogovnarik 1 сар өмнө
parent
commit
83a2d7cead

+ 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{}{