Documentation
¶
Overview ¶
Package errors provides error types and utilities for the goworker library.
Index ¶
- Variables
- func As(err error, target any) bool
- func Is(err, target error) bool
- func IsTemporary(err error) bool
- func IsTimeout(err error) bool
- func Join(errs ...error) error
- func New(text string) error
- func NewBrokerError(op, queue string, err error) error
- func NewConnectionError(uri string, err error) error
- func NewSerializationError(format string, err error) error
- func NewWorkerError(class, queue string, err error) error
- func Unwrap(err error) error
- type BrokerError
- type ConnectionError
- type SerializationError
- type WorkerError
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotConnected = errors.New("not connected") ErrQueueNotFound = errors.New("queue not found") ErrQueueFull = errors.New("queue is full") ErrWorkerNotFound = errors.New("worker not found") ErrInvalidPayload = errors.New("invalid payload") ErrTimeout = errors.New("operation timed out") ErrShutdown = errors.New("shutting down") ErrInvalidConfig = errors.New("invalid configuration") ErrEmptyClassName = errors.New("class name cannot be empty") ErrNilWorkerFunc = errors.New("worker function cannot be nil") ErrNoQueues = errors.New("no queues specified") )
Sentinel errors for common conditions
Functions ¶
func IsTemporary ¶
IsTemporary checks if an error is temporary and retryable
func NewBrokerError ¶
NewBrokerError creates a new broker error
func NewConnectionError ¶
NewConnectionError creates a new connection error
func NewSerializationError ¶
NewSerializationError creates a new serialization error
func NewWorkerError ¶
NewWorkerError creates a new worker error
Types ¶
type BrokerError ¶
type BrokerError struct {
Op string // operation being performed
Queue string // queue name (if applicable)
Err error // underlying error
}
BrokerError represents broker-specific errors
func (*BrokerError) Error ¶
func (e *BrokerError) Error() string
func (*BrokerError) Unwrap ¶
func (e *BrokerError) Unwrap() error
type ConnectionError ¶
type ConnectionError struct {
URI string // connection URI (may be redacted)
Err error // underlying error
}
ConnectionError represents connection-related errors
func (*ConnectionError) Error ¶
func (e *ConnectionError) Error() string
func (*ConnectionError) Temporary ¶
func (e *ConnectionError) Temporary() bool
func (*ConnectionError) Timeout ¶
func (e *ConnectionError) Timeout() bool
func (*ConnectionError) Unwrap ¶
func (e *ConnectionError) Unwrap() error
type SerializationError ¶
type SerializationError struct {
Format string // serialization format
Err error // underlying error
}
SerializationError represents serialization/deserialization errors
func (*SerializationError) Error ¶
func (e *SerializationError) Error() string
func (*SerializationError) Unwrap ¶
func (e *SerializationError) Unwrap() error
type WorkerError ¶
type WorkerError struct {
Class string // job class
Queue string // queue name
Err error // underlying error
}
WorkerError represents worker execution errors
func (*WorkerError) Error ¶
func (e *WorkerError) Error() string
func (*WorkerError) Unwrap ¶
func (e *WorkerError) Unwrap() error
Click to show internal directories.
Click to hide internal directories.