errors

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Configuration errors
	ErrMissingConfiguration = errors.New("missing required configuration")
	ErrInvalidConfiguration = errors.New("invalid configuration")

	// GitHub API errors
	ErrGitHubAPIAccess        = errors.New("GitHub API access error")
	ErrGitHubRateLimit        = errors.New("GitHub API rate limit exceeded")
	ErrGitHubAuthentication   = errors.New("GitHub authentication failed")
	ErrGitHubResourceNotFound = errors.New("GitHub resource not found")

	// Workflow errors
	ErrWorkflowNotFound  = errors.New("workflow not found")
	ErrWorkflowRunsEmpty = errors.New("no workflow runs found")
	ErrWorkflowJobsEmpty = errors.New("no workflow jobs found")

	// Data processing errors
	ErrDataProcessing = errors.New("data processing error")
	ErrDataParsing    = errors.New("data parsing error")
	ErrDataValidation = errors.New("data validation error")

	// System errors
	ErrFileSystem = errors.New("file system error")
	ErrNetwork    = errors.New("network error")
	ErrTimeout    = errors.New("operation timeout")
)

Error types for consistent error handling

Functions

func IsConfigurationError

func IsConfigurationError(err error) bool

Error checking helpers

func IsGitHubAPIError

func IsGitHubAPIError(err error) bool

func IsRateLimitError

func IsRateLimitError(err error) bool

func IsRetryableError

func IsRetryableError(err error) bool

func WrapWithContext

func WrapWithContext(err error, message string, context map[string]string) error

Wrap standard errors with context

Types

type AppError

type AppError struct {
	Type      string            `json:"type"`
	Message   string            `json:"message"`
	Operation string            `json:"operation,omitempty"`
	Code      string            `json:"code,omitempty"`
	Cause     error             `json:"cause,omitempty"`
	Context   map[string]string `json:"context,omitempty"`
	Retryable bool              `json:"retryable"`
}

AppError represents a structured application error

func NewConfigurationError

func NewConfigurationError(message string, cause error) *AppError

Error creation helpers

func NewDataProcessingError

func NewDataProcessingError(message string, cause error) *AppError

func NewGitHubAPIError

func NewGitHubAPIError(message string, cause error) *AppError

func NewRateLimitError

func NewRateLimitError(message string, cause error) *AppError

func NewSystemError

func NewSystemError(message string, cause error) *AppError

func NewWorkflowError

func NewWorkflowError(message string, cause error) *AppError

func (*AppError) Error

func (e *AppError) Error() string

func (*AppError) Unwrap

func (e *AppError) Unwrap() error

func (*AppError) WithContext

func (e *AppError) WithContext(key, value string) *AppError

func (*AppError) WithOperation

func (e *AppError) WithOperation(operation string) *AppError

Jump to

Keyboard shortcuts

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