errors

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConnectionClosed = Code(iota)
	ConnectionCloseError
	IllegalQueueName
	UnableToDeleteQueue
	UnknownQueue
	UnableToConnectToQueue
	QueueClosed
	QueueCloseError
	UnableToGetQueueLen
	UnableToGetMessage
	UnableToPutMessage
	NilMessage
	UnknownMessage
	AlreadyAcknowledged
	UnableToAcknowledgeMessage
	AlreadyRequeued
	UnableToRequeueMessage
	MessageFailed
)

The valid error codes

Variables

This section is empty.

Functions

func ShouldWrap

func ShouldWrap(e error) bool

ShouldWrap returns true if e satisfies all of the following:

  • e is not nil;
  • e is not equal to one of context.Canceled or context.DeadlineExceeded;
  • e is does not satisfy the Error interface.

Types

type Code

type Code uint8

Code represents a common queue error.

func (Code) New

func (c Code) New() error

New returns a new error with error code c. The error satisfies the Error interface.

func (Code) String

func (c Code) String() string

String returns a description of the error with error code c.

func (Code) Wrap

func (c Code) Wrap(e error) error

Wrap returns a new error with error code c and cause e. The error satisfies the Error interface.

type Error

type Error interface {
	// Code returns the code associated with this error.
	Code() Code
	// Error returns a string description of the error.
	Error() string
}

Error is the interface satisfied by an error with a Code.

Jump to

Keyboard shortcuts

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