Files
mtusi2026lab7/internal/dto/error.go
T
sxdees 2f2047909f
Skeleton contracts / contracts (pull_request) Blocked by required conditions
ЛР7 на 4: HTTPS, mTLS, OpenBao AppRole и ротация leaf.
Smoke/security/grade4/persistence/failover пройдены; REPORT и DEFENSE.
2026-12-02 23:08:27 +03:00

26 lines
776 B
Go

package dto
type ErrorCode string
const (
ErrorCodeInvalidRequest ErrorCode = "invalid_request"
ErrorCodeUnauthorized ErrorCode = "unauthorized"
ErrorCodeNotFound ErrorCode = "not_found"
ErrorCodeConflict ErrorCode = "conflict"
ErrorCodePayloadTooLarge ErrorCode = "payload_too_large"
ErrorCodeUnsupportedMediaType ErrorCode = "unsupported_media_type"
ErrorCodeRateLimited ErrorCode = "rate_limited"
ErrorCodeUnavailable ErrorCode = "unavailable"
ErrorCodeInternalError ErrorCode = "internal_error"
)
type ErrorResponse struct {
Error Error `json:"error"`
}
type Error struct {
Code ErrorCode `json:"code"`
Message string `json:"message"`
RequestID string `json:"request_id"`
}