errors

package
v0.3.22 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package errors provides domain-specific error types for goplexcli. These errors provide structured context for debugging and enable callers to handle errors appropriately using errors.As().

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotFound indicates a requested resource was not found
	ErrNotFound = errors.New("not found")

	// ErrInvalidConfig indicates the configuration is invalid
	ErrInvalidConfig = errors.New("invalid configuration")

	// ErrAuthRequired indicates authentication is required
	ErrAuthRequired = errors.New("authentication required")

	// ErrConnectionFailed indicates a connection to a server failed
	ErrConnectionFailed = errors.New("connection failed")

	// ErrCancelled indicates the operation was cancelled by the user
	ErrCancelled = errors.New("cancelled by user")
)

Common sentinel errors for error checking

Functions

This section is empty.

Types

type CacheError

type CacheError struct {
	Op     string // Operation (e.g., "Load", "Save")
	Path   string // Cache file path, if relevant
	Reason string // Human-readable reason
	Err    error  // Underlying error
}

CacheError represents an error that occurred during cache operations.

func NewCacheError

func NewCacheError(op, path, reason string, err error) *CacheError

NewCacheError creates a new CacheError.

func (*CacheError) Error

func (e *CacheError) Error() string

func (*CacheError) Unwrap

func (e *CacheError) Unwrap() error

type ConfigError

type ConfigError struct {
	Field   string // Config field that has an issue
	Message string // Human-readable description
	Err     error  // Underlying error, if any
}

ConfigError represents an error related to configuration.

func NewConfigError

func NewConfigError(field, message string) *ConfigError

NewConfigError creates a new ConfigError.

func NewConfigErrorWithCause

func NewConfigErrorWithCause(field, message string, err error) *ConfigError

NewConfigErrorWithCause creates a new ConfigError with an underlying cause.

func (*ConfigError) Error

func (e *ConfigError) Error() string

func (*ConfigError) Unwrap

func (e *ConfigError) Unwrap() error

type DownloadError

type DownloadError struct {
	Op     string // Operation (e.g., "Download", "DownloadMultiple")
	Path   string // File path or rclone path involved
	Reason string // Human-readable reason
	Err    error  // Underlying error
}

DownloadError represents an error that occurred during a download operation.

func NewDownloadError

func NewDownloadError(op, path, reason string, err error) *DownloadError

NewDownloadError creates a new DownloadError.

func (*DownloadError) Error

func (e *DownloadError) Error() string

func (*DownloadError) Unwrap

func (e *DownloadError) Unwrap() error

type PlayerError

type PlayerError struct {
	Op     string // Operation (e.g., "Play", "PlayMultiple")
	Player string // Player name (e.g., "mpv")
	Reason string // Human-readable reason
	Err    error  // Underlying error
}

PlayerError represents an error that occurred during media playback.

func NewPlayerError

func NewPlayerError(op, player, reason string, err error) *PlayerError

NewPlayerError creates a new PlayerError.

func (*PlayerError) Error

func (e *PlayerError) Error() string

func (*PlayerError) Unwrap

func (e *PlayerError) Unwrap() error

type PlexError

type PlexError struct {
	Op         string // Operation being performed (e.g., "GetAllMedia", "Authenticate")
	Server     string // Server URL or name
	StatusCode int    // HTTP status code, if applicable
	Err        error  // Underlying error
}

PlexError represents an error that occurred while interacting with the Plex API.

func NewPlexError

func NewPlexError(op, server string, err error) *PlexError

NewPlexError creates a new PlexError.

func NewPlexErrorWithStatus

func NewPlexErrorWithStatus(op, server string, statusCode int, err error) *PlexError

NewPlexErrorWithStatus creates a new PlexError with an HTTP status code.

func (*PlexError) Error

func (e *PlexError) Error() string

func (*PlexError) Unwrap

func (e *PlexError) Unwrap() error

type QueueError

type QueueError struct {
	Op     string // Operation (e.g., "Load", "Save", "Add")
	Reason string // Human-readable reason
	Err    error  // Underlying error
}

QueueError represents an error that occurred during queue operations.

func NewQueueError

func NewQueueError(op, reason string, err error) *QueueError

NewQueueError creates a new QueueError.

func (*QueueError) Error

func (e *QueueError) Error() string

func (*QueueError) Unwrap

func (e *QueueError) Unwrap() error

type StreamError

type StreamError struct {
	Op     string // Operation (e.g., "Publish", "Discover")
	Reason string // Human-readable reason
	Err    error  // Underlying error
}

StreamError represents an error that occurred during stream operations.

func NewStreamError

func NewStreamError(op, reason string, err error) *StreamError

NewStreamError creates a new StreamError.

func (*StreamError) Error

func (e *StreamError) Error() string

func (*StreamError) Unwrap

func (e *StreamError) Unwrap() error

Jump to

Keyboard shortcuts

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