Documentation
¶
Overview ¶
Package infra provides infrastructure-related error types for the application.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DatabaseError ¶
type DatabaseError struct {
*InfrastructureError
Operation string `json:"operation,omitempty"`
Table string `json:"table,omitempty"`
}
DatabaseError represents a database operation failure. It extends InfrastructureError with database-specific information.
func NewDatabaseError ¶
func NewDatabaseError(message string, operation string, table string, cause error) *DatabaseError
NewDatabaseError creates a new DatabaseError.
func (*DatabaseError) IsDatabaseError ¶
func (e *DatabaseError) IsDatabaseError() bool
IsDatabaseError identifies this as a database error.
type ExternalServiceError ¶
type ExternalServiceError struct {
*InfrastructureError
ServiceName string `json:"service_name,omitempty"`
Endpoint string `json:"endpoint,omitempty"`
}
ExternalServiceError represents an external service call failure. It extends InfrastructureError with service-specific information.
func NewExternalServiceError ¶
func NewExternalServiceError(message string, serviceName string, endpoint string, cause error) *ExternalServiceError
NewExternalServiceError creates a new ExternalServiceError.
func (*ExternalServiceError) IsExternalServiceError ¶
func (e *ExternalServiceError) IsExternalServiceError() bool
IsExternalServiceError identifies this as an external service error.
type InfrastructureError ¶
InfrastructureError represents an infrastructure-related error. It extends BaseError with infrastructure-specific information.
func NewInfrastructureError ¶
func NewInfrastructureError(code core.ErrorCode, message string, cause error) *InfrastructureError
NewInfrastructureError creates a new InfrastructureError.
func (*InfrastructureError) IsInfrastructureError ¶
func (e *InfrastructureError) IsInfrastructureError() bool
IsInfrastructureError identifies this as an infrastructure error.
type NetworkError ¶
type NetworkError struct {
*InfrastructureError
Host string `json:"host,omitempty"`
Port string `json:"port,omitempty"`
}
NetworkError represents a network-related error. It extends InfrastructureError with network-specific information.
func NewNetworkError ¶
func NewNetworkError(message string, host string, port string, cause error) *NetworkError
NewNetworkError creates a new NetworkError.
func (*NetworkError) IsNetworkError ¶
func (e *NetworkError) IsNetworkError() bool
IsNetworkError identifies this as a network error.