Versions in this module Expand all Collapse all v0 v0.2.0 May 19, 2026 Changes in this version + func FromGRPCError(err error) error + func GetGRPCCode(err error) codes.Code + func GetHTTPStatus(err error) int + func Is(err error, code Code) bool + type Code string + const CodeAlreadyExists + const CodeBusinessRuleViolation + const CodeCapacityExceeded + const CodeChecksumMismatch + const CodeConfigurationError + const CodeConflict + const CodeConnectionFailed + const CodeDNSResolutionFailed + const CodeDataCorruption + const CodeDatabaseError + const CodeExternalService + const CodeFileNotFound + const CodeForbidden + const CodeGone + const CodeInsufficientSpace + const CodeInternalError + const CodeInvalidArgument + const CodeInvalidFormat + const CodeMissingDependency + const CodeMissingField + const CodeNetworkError + const CodeNotFound + const CodeOperationNotAllowed + const CodeOutOfRange + const CodePreconditionFailed + const CodeQuotaExceeded + const CodeRateLimited + const CodeResourceLocked + const CodeServiceUnavailable + const CodeStorageError + const CodeTaken + const CodeTimeout + const CodeUnauthenticated + const CodeUnauthorized + const CodeValidationFailed + const CodeVersionMismatch + func (c Code) String() string + type Detail interface + Code func() Code + Field func() string + Message func() string + Value func() interface{} + func NewDetail(field string, code Code, message string, value interface{}) Detail + type Error interface + Cause func() error + Code func() Code + Details func() []Detail + GRPCCode func() codes.Code + HTTPStatus func() int + Message func() string + RequestID func() string + Service func() string + Timestamp func() time.Time + func AlreadyExists(resource string, identifier interface{}, opts ...Option) Error + func As(err error) (Error, bool) + func Conflict(message string, opts ...Option) Error + func Forbidden(message string, opts ...Option) Error + func InternalError(message string, opts ...Option) Error + func InvalidArgument(message string, opts ...Option) Error + func InvalidFormat(field string, value interface{}, expectedFormat string, opts ...Option) Error + func MissingField(field string, opts ...Option) Error + func New(code Code, opts ...Option) Error + func NotFound(resource string, identifier interface{}, opts ...Option) Error + func OutOfRange(field string, value interface{}, min, max interface{}, opts ...Option) Error + func RateLimited(message string, opts ...Option) Error + func ServiceUnavailable(message string, opts ...Option) Error + func Timeout(message string, opts ...Option) Error + func Unauthenticated(message string, opts ...Option) Error + func Unauthorized(message string, opts ...Option) Error + func ValidationError(opts ...ValidationOption) Error + func ValidationFailed(message string, opts ...Option) Error + func Wrap(err error, code Code, opts ...Option) Error + func WrapInternal(err error, message string, opts ...Option) Error + func WrapNotFound(err error, resource string, identifier interface{}, opts ...Option) Error + func WrapValidation(err error, message string, opts ...Option) Error + type Option func(*errorImpl) + func WithDetail(field string, code Code, message string, value interface{}) Option + func WithDetails(details ...Detail) Option + func WithGRPCCode(code codes.Code) Option + func WithHTTPStatus(status int) Option + func WithMessage(message string) Option + func WithRequestID(requestID string) Option + func WithService(service string) Option + type ValidationOption func(*validationConfig) + func WithCustomValidation(field string, code Code, message string, value interface{}) ValidationOption + func WithInvalidFormat(field string, value interface{}, expectedFormat string) ValidationOption + func WithOutOfRange(field string, value interface{}, min, max interface{}) ValidationOption + func WithRequiredField(field string) ValidationOption + func WithValidationDetail(detail Detail) ValidationOption + func WithValidationDetails(details ...Detail) ValidationOption + func WithValidationMessage(message string) ValidationOption