errors

package
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 24, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package errors provides error types and utilities for the goworker library.

Index

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 As added in v0.0.2

func As(err error, target any) bool

func Is added in v0.0.2

func Is(err, target error) bool

func IsTemporary

func IsTemporary(err error) bool

IsTemporary checks if an error is temporary and retryable

func IsTimeout

func IsTimeout(err error) bool

IsTimeout checks if an error is a timeout

func Join added in v0.0.2

func Join(errs ...error) error

func New added in v0.0.2

func New(text string) error

func NewBrokerError

func NewBrokerError(op, queue string, err error) error

NewBrokerError creates a new broker error

func NewConnectionError

func NewConnectionError(uri string, err error) error

NewConnectionError creates a new connection error

func NewSerializationError

func NewSerializationError(format string, err error) error

NewSerializationError creates a new serialization error

func NewWorkerError

func NewWorkerError(class, queue string, err error) error

NewWorkerError creates a new worker error

func Unwrap added in v0.0.2

func Unwrap(err error) 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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL