Versions in this module Expand all Collapse all v1 v1.0.0 Jan 28, 2026 Changes in this version + func GetHTTPStatus(err error) int + func IsServiceError(err error) bool + type ErrorCode string + const ErrCodeAlreadyExists + const ErrCodeAttestationFailed + const ErrCodeBlockchainError + const ErrCodeConflict + const ErrCodeDatabaseError + const ErrCodeDecryptionFailed + const ErrCodeEncryptionFailed + const ErrCodeExternalAPI + const ErrCodeForbidden + const ErrCodeInsufficientFunds + const ErrCodeInternal + const ErrCodeInvalidFormat + const ErrCodeInvalidInput + const ErrCodeInvalidSignature + const ErrCodeInvalidToken + const ErrCodeMissingParameter + const ErrCodeNotFound + const ErrCodeOutOfRange + const ErrCodeOwnershipRequired + const ErrCodeRateLimitExceeded + const ErrCodeSealingFailed + const ErrCodeSigningFailed + const ErrCodeTimeout + const ErrCodeTokenExpired + const ErrCodeUnauthorized + const ErrCodeUnsealingFailed + const ErrCodeVerificationFailed + type ServiceError struct + Code ErrorCode + Details map[string]interface{} + Err error + HTTPStatus int + Message string + func AlreadyExists(resource, id string) *ServiceError + func AttestationFailed(err error) *ServiceError + func BlockchainError(operation string, err error) *ServiceError + func Conflict(message string) *ServiceError + func DatabaseError(operation string, err error) *ServiceError + func DecryptionFailed(err error) *ServiceError + func EncryptionFailed(err error) *ServiceError + func ExternalAPIError(service string, err error) *ServiceError + func Forbidden(message string) *ServiceError + func GetServiceError(err error) *ServiceError + func InsufficientFunds(required, available string) *ServiceError + func Internal(message string, err error) *ServiceError + func InvalidFormat(field, expected string) *ServiceError + func InvalidInput(field, reason string) *ServiceError + func InvalidSignature(err error) *ServiceError + func InvalidToken(err error) *ServiceError + func MissingParameter(param string) *ServiceError + func New(code ErrorCode, message string, httpStatus int) *ServiceError + func NotFound(resource, id string) *ServiceError + func OutOfRange(field string, minValue, maxValue interface{}) *ServiceError + func OwnershipRequired(resource string) *ServiceError + func RateLimitExceeded(limit int, window string) *ServiceError + func SealingFailed(err error) *ServiceError + func SigningFailed(err error) *ServiceError + func Timeout(operation string) *ServiceError + func TokenExpired() *ServiceError + func Unauthorized(message string) *ServiceError + func UnsealingFailed(err error) *ServiceError + func VerificationFailed(err error) *ServiceError + func Wrap(code ErrorCode, message string, httpStatus int, err error) *ServiceError + func (e *ServiceError) Error() string + func (e *ServiceError) Unwrap() error + func (e *ServiceError) WithDetails(key string, value interface{}) *ServiceError