forked from mtusi2026/mtusi2026lab2
26 lines
776 B
Go
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"`
|
|
}
|