Files
mtusi2026lab2/internal/dto/error.go
T
2026-10-02 11:45:26 +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"`
}