Documentation
¶
Overview ¶
Package errors provides custom error types for GitHubby
Index ¶
Constants ¶
This section is empty.
Variables ¶
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") ErrForbidden = errors.New("forbidden: insufficient permissions") )
Common errors
Functions ¶
func IsForbidden ¶ added in v1.0.12
IsForbidden checks if the error is a forbidden (403 permission-denied) error
func IsNotFound ¶
IsNotFound checks if the error is a not found error
func IsRateLimited ¶
IsRateLimited checks if the error is a rate limit error. Only matches ErrRateLimited sentinel and 429 APIError status codes. Permission-denied 403s use ErrForbidden instead and are NOT retried.
func IsUnauthorized ¶ added in v1.0.12
IsUnauthorized checks if the error is an unauthorized (401) error
Types ¶
type APIError ¶
APIError represents a GitHub API error
func NewAPIError ¶
NewAPIError creates a new API 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 NewAuthErrorWithReason ¶ added in v1.0.12
NewAuthErrorWithReason creates a user-friendly authentication error that includes a specific reason
func NewExpiredTokenError ¶ added in v1.0.12
NewExpiredTokenError creates an auth error that identifies which token source failed
type ValidationError ¶
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