refactor(httpx): drop duplicate WriteError, add WriteInternal

This commit is contained in:
kk10
2026-10-05 11:41:34 +03:00
parent 5d6f5a397f
commit b94e7813ee
6 changed files with 19 additions and 77 deletions
+2 -1
View File
@@ -8,6 +8,7 @@ import (
"time"
"mtusi2026-messenger/internal/dto"
"mtusi2026-messenger/internal/httpx"
)
const readyPingTimeout = 2 * time.Second
@@ -40,7 +41,7 @@ func (h *HealthHandler) Ready(w http.ResponseWriter, r *http.Request) {
if err := h.db.Ping(ctx); err != nil {
h.log.ErrorContext(r.Context(), "readiness check failed", "error", err)
WriteError(
httpx.WriteError(
w,
http.StatusServiceUnavailable,
dto.ErrorCodeUnavailable,