errors

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package errors provides structured error types for the message gateway.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoRecipients      = errors.New("no recipients specified")
	ErrNoFromAddress     = errors.New("no from address specified")
	ErrNoDefaultProvider = errors.New("no default provider configured")
)

Sentinel errors for common failure cases.

Functions

func IsConfigError

func IsConfigError(err error) bool

IsConfigError checks if an error is a ConfigError.

func IsProviderError

func IsProviderError(err error) bool

IsProviderError checks if an error is a ProviderError.

func IsProviderNotFound

func IsProviderNotFound(err error) bool

IsProviderNotFound checks if an error is a ProviderNotFoundError.

Types

type ConfigError

type ConfigError struct {
	Provider string
	Field    string
	Message  string
	Err      error
}

ConfigError represents a configuration error.

func NewConfigError

func NewConfigError(provider, field, message string) *ConfigError

NewConfigError creates a new ConfigError.

func (*ConfigError) Error

func (e *ConfigError) Error() string

func (*ConfigError) Unwrap

func (e *ConfigError) Unwrap() error

type ProviderError

type ProviderError struct {
	Provider   string
	StatusCode int
	Message    string
	Err        error
}

ProviderError represents an error from a message provider.

func NewProviderError

func NewProviderError(provider, message string, statusCode int, err error) *ProviderError

NewProviderError creates a new ProviderError.

func (*ProviderError) Error

func (e *ProviderError) Error() string

func (*ProviderError) Unwrap

func (e *ProviderError) Unwrap() error

type ProviderNotFoundError

type ProviderNotFoundError struct {
	ProviderType string
	ProviderName string
}

ProviderNotFoundError indicates a requested provider doesn't exist.

func NewProviderNotFoundError

func NewProviderNotFoundError(providerType, providerName string) *ProviderNotFoundError

NewProviderNotFoundError creates a new ProviderNotFoundError.

func (*ProviderNotFoundError) Error

func (e *ProviderNotFoundError) Error() string

Jump to

Keyboard shortcuts

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