lab2 done
Skeleton contracts / contracts (pull_request) Canceled after 0s

This commit is contained in:
Khakimov Dmitrij
2026-10-06 22:45:35 +03:00
parent 47a3cd582d
commit f99ddb1951
74 changed files with 2785 additions and 112 deletions
+7
View File
@@ -33,10 +33,17 @@ func (h *Chat) useCaseError(c echo.Context, err error) error {
}
status := http.StatusInternalServerError
switch applicationError.Code {
case domain.ErrorUnavailable:
status = http.StatusServiceUnavailable
case domain.ErrorInvalid:
status = http.StatusBadRequest
case domain.ErrorUnauthorized:
status = http.StatusUnauthorized
challenge := `Bearer realm="messenger"`
if c.Path() == "/api/v1/auth/sessions" {
challenge = `Basic realm="messenger", charset="UTF-8"`
}
c.Response().Header().Set("WWW-Authenticate", challenge)
case domain.ErrorNotFound:
status = http.StatusNotFound
case domain.ErrorConflict: