Documentation
¶
Index ¶
- func IsAuthError(err error) bool
- func IsClientError(err error) bool
- func IsConfigError(err error) bool
- func IsContextError(err error) bool
- func IsErrorOfType(err error, errorType ErrorType) bool
- func IsIOError(err error) bool
- func IsOperationError(err error) bool
- func IsSystemError(err error) bool
- func IsValidationError(err error) bool
- type DomainError
- func NewAuthError(domain, message string, cause error) *DomainError
- func NewClientError(domain, message string, cause error) *DomainError
- func NewConfigError(domain, message string, cause error) *DomainError
- func NewContextError(domain, message string, cause error) *DomainError
- func NewIOError(domain, message string, cause error) *DomainError
- func NewOperationError(domain, message string, cause error) *DomainError
- func NewSystemError(domain, message string, cause error) *DomainError
- func NewValidationError(domain, message string, cause error) *DomainError
- type ErrorType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsAuthError ¶
IsAuthError checks if an error is an authentication error
func IsClientError ¶
IsClientError checks if an error is a client error
func IsConfigError ¶
IsConfigError checks if an error is a configuration error
func IsContextError ¶
IsContextError checks if an error is a context error
func IsErrorOfType ¶
IsErrorOfType checks if an error is of a specific type
func IsOperationError ¶
IsOperationError checks if an error is an operation error
func IsSystemError ¶
IsSystemError checks if an error is a system error
func IsValidationError ¶
IsValidationError checks if an error is a validation error
Types ¶
type DomainError ¶
type DomainError struct {
Type ErrorType
Domain string
Message string
Cause error
Timestamp time.Time
Details map[string]interface{}
}
DomainError is the base error type for domain-specific errors
func NewAuthError ¶
func NewAuthError(domain, message string, cause error) *DomainError
NewAuthError creates a new authentication error
func NewClientError ¶
func NewClientError(domain, message string, cause error) *DomainError
NewClientError creates a new client initialization error
func NewConfigError ¶
func NewConfigError(domain, message string, cause error) *DomainError
NewConfigError creates a new configuration error
func NewContextError ¶
func NewContextError(domain, message string, cause error) *DomainError
NewContextError creates a new context error
func NewIOError ¶
func NewIOError(domain, message string, cause error) *DomainError
NewIOError creates a new input/output error
func NewOperationError ¶
func NewOperationError(domain, message string, cause error) *DomainError
NewOperationError creates a new operation error
func NewSystemError ¶
func NewSystemError(domain, message string, cause error) *DomainError
NewSystemError creates a new system-level error
func NewValidationError ¶
func NewValidationError(domain, message string, cause error) *DomainError
NewValidationError creates a new validation error
func (*DomainError) Error ¶
func (e *DomainError) Error() string
Error implements the error interface
func (*DomainError) Unwrap ¶
func (e *DomainError) Unwrap() error
Unwrap returns the cause of the error
func (*DomainError) WithDetail ¶
func (e *DomainError) WithDetail(key string, value interface{}) *DomainError
WithDetail adds a detail to the error
type ErrorType ¶
type ErrorType string
ErrorType represents different categories of errors
const ( // AuthError represents authentication/authorization errors AuthError ErrorType = "auth" // ConfigError represents configuration errors ConfigError ErrorType = "config" // ClientError represents client initialization errors ClientError ErrorType = "client" // OperationError represents errors during operations OperationError ErrorType = "operation" // ValidationError represents validation errors ValidationError ErrorType = "validation" // IOError represents input/output errors IOError ErrorType = "io" // ContextError represents context-related errors ContextError ErrorType = "context" // SystemError represents system-level errors SystemError ErrorType = "system" // UnknownError represents unclassified errors UnknownError ErrorType = "unknown" )