errors

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrClientClosed is returned when attempting to use a closed client.
	ErrClientClosed = errors.New("rabbitmq: client is closed")

	// ErrNoConnection is returned when the client has no active connection.
	ErrNoConnection = errors.New("rabbitmq: no active connection")

	// ErrNoChannel is returned when the client has no active channel.
	ErrNoChannel = errors.New("rabbitmq: no active channel")

	// ErrMaxRetriesExceeded is returned when a message exceeds max retries.
	ErrMaxRetriesExceeded = errors.New("rabbitmq: max retries exceeded")

	// ErrNoHandlersRegistered is returned when StartConsume is called without registering any handlers.
	ErrNoHandlersRegistered = errors.New("rabbitmq: no handlers registered, call RegisterHandler before StartConsume")

	// ErrPublishNotConfirmed is returned when a message publish is not confirmed by RabbitMQ.
	ErrPublishNotConfirmed = errors.New("rabbitmq: message publish was not confirmed by broker")

	// ErrPublishConfirmTimeout is returned when waiting for publish confirmation times out.
	ErrPublishConfirmTimeout = errors.New("rabbitmq: timeout waiting for publish confirmation")
)

Sentinel errors

Functions

func NewConfigFieldError

func NewConfigFieldError(field, message string) error

newConfigFieldError creates a new ConfigError for a specific field.

func NewConnectionError

func NewConnectionError(operation string, cause error) error

newConnectionError creates a new ConnectionError.

func NewConsumeError

func NewConsumeError(queue string, cause error) error

newConsumeError creates a new ConsumeError.

func NewHandlerError

func NewHandlerError(eventType, messageID string, cause error) error

newHandlerError creates a new HandlerError.

func NewPublishError

func NewPublishError(exchange, routingKey string, cause error) error

newPublishError creates a new PublishError.

func NewTopologyError

func NewTopologyError(operation, resource string, cause error) error

newTopologyError creates a new TopologyError.

Types

type ConfigError

type ConfigError struct {
	Field   string
	Message string
}

ConfigError represents a configuration validation error.

func (*ConfigError) Error

func (e *ConfigError) Error() string

type ConnectionError

type ConnectionError struct {
	Operation string
	Cause     error
}

ConnectionError represents a connection-related error.

func (*ConnectionError) Error

func (e *ConnectionError) Error() string

func (*ConnectionError) Unwrap

func (e *ConnectionError) Unwrap() error

type ConsumeError

type ConsumeError struct {
	Queue string
	Cause error
}

ConsumeError represents an error during message consumption.

func (*ConsumeError) Error

func (e *ConsumeError) Error() string

func (*ConsumeError) Unwrap

func (e *ConsumeError) Unwrap() error

type HandlerError

type HandlerError struct {
	EventType string
	MessageID string
	Cause     error
}

HandlerError represents an error returned by a message handler.

func (*HandlerError) Error

func (e *HandlerError) Error() string

func (*HandlerError) Unwrap

func (e *HandlerError) Unwrap() error

type PublishError

type PublishError struct {
	Exchange   string
	RoutingKey string
	Cause      error
}

PublishError represents an error during message publishing.

func (*PublishError) Error

func (e *PublishError) Error() string

func (*PublishError) Unwrap

func (e *PublishError) Unwrap() error

type TopologyError

type TopologyError struct {
	Operation string // "declare_exchange", "declare_queue", "bind_queue"
	Resource  string // name of the exchange/queue
	Cause     error
}

TopologyError represents an error during topology setup (exchanges, queues, bindings).

func (*TopologyError) Error

func (e *TopologyError) Error() string

func (*TopologyError) Unwrap

func (e *TopologyError) Unwrap() error

Jump to

Keyboard shortcuts

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