Documentation
¶
Overview ¶
Package errors provides domain-specific error types for the SDK. All error types support error unwrapping via errors.As() and errors.Is().
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToErrorDetail ¶
func ToErrorDetail(err error) *entities.ErrorDetail
ToErrorDetail converts a Go error to our structured ErrorDetail. This function recognizes custom error types and categorizes them appropriately.
Types ¶
type CapabilityError ¶
type CapabilityError struct {
Required string // Required capability (e.g., "network:outbound", "exec")
Pattern string // Optional: specific pattern that was denied
}
CapabilityError represents a capability check failure.
func (*CapabilityError) Error ¶
func (e *CapabilityError) Error() string
func (*CapabilityError) ToErrorDetail ¶
func (e *CapabilityError) ToErrorDetail() *entities.ErrorDetail
ToErrorDetail implements DetailedError.
type ConfigError ¶
ConfigError represents a configuration validation error.
func (*ConfigError) Error ¶
func (e *ConfigError) Error() string
func (*ConfigError) ToErrorDetail ¶
func (e *ConfigError) ToErrorDetail() *entities.ErrorDetail
ToErrorDetail implements DetailedError.
func (*ConfigError) Unwrap ¶
func (e *ConfigError) Unwrap() error
type DNSError ¶
DNSError represents a DNS lookup failure.
func (*DNSError) ToErrorDetail ¶
func (e *DNSError) ToErrorDetail() *entities.ErrorDetail
ToErrorDetail implements DetailedError.
type DetailedError ¶
type DetailedError interface {
error
ToErrorDetail() *entities.ErrorDetail
}
DetailedError is an interface for custom error types that can convert themselves to a structured ErrorDetail. This follows the Open/Closed Principle - new error types only need to implement this interface without modifying ToErrorDetail.
type ErrorDetail ¶
type ErrorDetail = entities.ErrorDetail
ErrorDetail is an alias to entities.ErrorDetail for backward compatibility/convenience.
type ExecError ¶
ExecError represents a command execution error.
func (*ExecError) ToErrorDetail ¶
func (e *ExecError) ToErrorDetail() *entities.ErrorDetail
ToErrorDetail implements DetailedError.
type HTTPError ¶
HTTPError represents an HTTP request failure.
func (*HTTPError) ToErrorDetail ¶
func (e *HTTPError) ToErrorDetail() *entities.ErrorDetail
ToErrorDetail implements DetailedError.
type MemoryError ¶
type MemoryError struct {
Requested int // Requested allocation size
Current int // Current total allocated
Limit int // Maximum allowed
}
MemoryError represents a memory allocation failure.
func (*MemoryError) Error ¶
func (e *MemoryError) Error() string
func (*MemoryError) ToErrorDetail ¶
func (e *MemoryError) ToErrorDetail() *entities.ErrorDetail
ToErrorDetail implements DetailedError.
type NetworkError ¶
NetworkError represents a network operation failure.
func (*NetworkError) Error ¶
func (e *NetworkError) Error() string
func (*NetworkError) ToErrorDetail ¶
func (e *NetworkError) ToErrorDetail() *entities.ErrorDetail
ToErrorDetail implements DetailedError.
func (*NetworkError) Unwrap ¶
func (e *NetworkError) Unwrap() error
type SchemaError ¶
SchemaError represents a schema generation or validation error.
func (*SchemaError) Error ¶
func (e *SchemaError) Error() string
func (*SchemaError) ToErrorDetail ¶
func (e *SchemaError) ToErrorDetail() *entities.ErrorDetail
ToErrorDetail implements DetailedError.
func (*SchemaError) Unwrap ¶
func (e *SchemaError) Unwrap() error
type TCPError ¶
TCPError represents a TCP connection failure.
func (*TCPError) ToErrorDetail ¶
func (e *TCPError) ToErrorDetail() *entities.ErrorDetail
ToErrorDetail implements DetailedError.
type TimeoutError ¶
TimeoutError represents a timeout during an operation.
func (*TimeoutError) Error ¶
func (e *TimeoutError) Error() string
func (*TimeoutError) Timeout ¶
func (e *TimeoutError) Timeout() bool
func (*TimeoutError) ToErrorDetail ¶
func (e *TimeoutError) ToErrorDetail() *entities.ErrorDetail
ToErrorDetail implements DetailedError.
type WireFormatError ¶
WireFormatError represents a wire format encoding/decoding error.
func (*WireFormatError) Error ¶
func (e *WireFormatError) Error() string
func (*WireFormatError) ToErrorDetail ¶
func (e *WireFormatError) ToErrorDetail() *entities.ErrorDetail
ToErrorDetail implements DetailedError.
func (*WireFormatError) Unwrap ¶
func (e *WireFormatError) Unwrap() error