errors

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnsupportedFormat  = errors.New("unsupported image format")
	ErrInvalidDimensions  = errors.New("invalid dimensions")
	ErrEmptyInput         = errors.New("empty input")
	ErrContextCanceled    = errors.New("context canceled")
	ErrWorkerPoolFull     = errors.New("worker pool queue full")
	ErrStorageUnavailable = errors.New("storage unavailable")
)

Sentinel errors for common failure modes.

Functions

func IsCategory

func IsCategory(err error, cat Category) bool

IsCategory reports whether err belongs to the given category.

func IsRetryable

func IsRetryable(err error) bool

IsRetryable reports whether err represents a transient failure.

func Wrap

func Wrap(category Category, op string, err error) error

Wrap wraps an existing error with context.

Types

type Category

type Category string

Category classifies error types for targeted handling and monitoring.

const (
	CategoryDecode    Category = "decode"
	CategoryEncode    Category = "encode"
	CategoryPipeline  Category = "pipeline"
	CategoryStorage   Category = "storage"
	CategoryConfig    Category = "config"
	CategoryTransient Category = "transient"
	CategoryInput     Category = "input"
)

type ProcessingError

type ProcessingError struct {
	Category  Category
	Op        string // operation name
	Err       error
	Retryable bool
}

ProcessingError is the structured error type used throughout the module.

func New

func New(category Category, op string, err error) *ProcessingError

New creates a non-retryable ProcessingError.

func Transient

func Transient(op string, err error) *ProcessingError

Transient creates a retryable ProcessingError.

func (*ProcessingError) Error

func (e *ProcessingError) Error() string

func (*ProcessingError) Unwrap

func (e *ProcessingError) Unwrap() error

Jump to

Keyboard shortcuts

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