Versions in this module Expand all Collapse all v0 v0.1.0 Feb 15, 2026 Changes in this version + func As(err error, target interface{}) bool + func GetHTTPStatus(err error) int + func Is(err error, target error) bool + func IsForbidden(err error) bool + func IsInternal(err error) bool + func IsNotFound(err error) bool + func IsUnauthorized(err error) bool + func IsValidation(err error) bool + type Error struct + Code ErrorCode + Details map[string]interface{} + Err error + Message string + func AccountFrozen(message string) *Error + func BadRequest(message string) *Error + func Conflict(message string) *Error + func Database(message string) *Error + func DatabaseWrap(err error, message string) *Error + func DuplicateIdempotencyKey(key string) *Error + func Forbidden(message string) *Error + func Gone(message string) *Error + func InsufficientFunds(message string) *Error + func Internal(message string) *Error + func InternalWrap(err error, message string) *Error + func InvalidOTP(attemptsRemaining int) *Error + func LimitExceeded(message string) *Error + func New(code ErrorCode, message string) *Error + func NotFound(resource string) *Error + func NotFoundWithID(resource, id string) *Error + func Timeout(message string) *Error + func TooManyRequests(message string) *Error + func TransactionFailed(message string) *Error + func Unauthorized(message string) *Error + func Unavailable(message string) *Error + func Validation(message string) *Error + func ValidationWithFields(message string, fields map[string]string) *Error + func VerificationExpired() *Error + func VerificationRequired(message string) *Error + func Wrap(err error, code ErrorCode, message string) *Error + func Wrapf(err error, code ErrorCode, format string, args ...interface{}) *Error + func (e *Error) AddDetail(key string, value interface{}) *Error + func (e *Error) Error() string + func (e *Error) HTTPStatusCode() int + func (e *Error) Unwrap() error + func (e *Error) WithDetails(details map[string]interface{}) *Error + type ErrorCode string + const ErrCodeAccountFrozen + const ErrCodeBadRequest + const ErrCodeConflict + const ErrCodeDatabaseError + const ErrCodeDuplicateIdempotencyKey + const ErrCodeForbidden + const ErrCodeGone + const ErrCodeInsufficientFunds + const ErrCodeInternal + const ErrCodeInvalidAmount + const ErrCodeInvalidCurrency + const ErrCodeInvalidOTP + const ErrCodeLimitExceeded + const ErrCodeNotFound + const ErrCodePrecondition + const ErrCodeRateLimit + const ErrCodeTimeout + const ErrCodeTransactionFailed + const ErrCodeUnauthorized + const ErrCodeUnavailable + const ErrCodeValidation + const ErrCodeVerificationExpired + const ErrCodeVerificationRequired + func GetErrorCode(err error) ErrorCode