errors

package
v1.0.4 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 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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