lab2: fix review — cache consistency, readiness, timeouts, uuid validation, tuple index
Skeleton contracts / contracts (pull_request) Canceled after 0s
Skeleton contracts / contracts (pull_request) Canceled after 0s
This commit is contained in:
@@ -91,6 +91,8 @@ func mapError(err error) (int, string) {
|
||||
return http.StatusNotFound, "not_found"
|
||||
case errors.Is(err, service.ErrConflict):
|
||||
return http.StatusConflict, "conflict"
|
||||
case errors.Is(err, service.ErrUnavailable):
|
||||
return http.StatusServiceUnavailable, "unavailable"
|
||||
default:
|
||||
return http.StatusInternalServerError, "internal_error"
|
||||
}
|
||||
@@ -108,6 +110,8 @@ func messageFor(code string) string {
|
||||
return "Конфликт"
|
||||
case "internal_error":
|
||||
return "Внутренняя ошибка"
|
||||
case "unavailable":
|
||||
return "Сервис недоступен"
|
||||
default:
|
||||
return "Ошибка"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user