errors

package
v1.0.8 Latest Latest
Warning

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

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

Documentation

Overview

Package errors provides custom error types for GitHubby

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingToken      = errors.New("missing required argument 'token'")
	ErrMissingRepository = errors.New("missing required argument 'repository'")
	ErrMissingFilter     = errors.New("missing at least one filter flag (run with --help for more information)")
	ErrInvalidRepository = errors.New("invalid repository format (expected owner/repo)")
	ErrRateLimited       = errors.New("GitHub API rate limit exceeded")
	ErrNotFound          = errors.New("resource not found")
	ErrUnauthorized      = errors.New("unauthorized: invalid or expired token")
)

Common errors

Functions

func IsNotFound

func IsNotFound(err error) bool

IsNotFound checks if the error is a not found error

func IsRateLimited

func IsRateLimited(err error) bool

IsRateLimited checks if the error is a rate limit error

Types

type APIError

type APIError struct {
	StatusCode int
	Message    string
	Err        error
}

APIError represents a GitHub API error

func NewAPIError

func NewAPIError(statusCode int, message string, err error) *APIError

NewAPIError creates a new API error

func (*APIError) Error

func (e *APIError) Error() string

func (*APIError) Unwrap

func (e *APIError) Unwrap() error

type AuthError

type AuthError struct {
	Message string
}

AuthError represents an authentication error with helpful guidance

func NewAuthError

func NewAuthError() *AuthError

NewAuthError creates a user-friendly authentication error

func (*AuthError) Error

func (e *AuthError) Error() string

type ValidationError

type ValidationError struct {
	Field   string
	Message string
}

ValidationError represents an input validation error

func NewValidationError

func NewValidationError(field, message string) *ValidationError

NewValidationError creates a new validation error

func (*ValidationError) Error

func (e *ValidationError) Error() string

Jump to

Keyboard shortcuts

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