{"modulePath":"github.com/Didstopia/githubby","version":"v1.1.5","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package errors\n\nPackage errors provides custom error types for GitHubby\n\n## Variables\n\n```go\nvar (\n\tErrMissingToken      = errors.New(\"missing required argument 'token'\")\n\tErrMissingRepository = errors.New(\"missing required argument 'repository'\")\n\tErrMissingFilter     = errors.New(\"missing at least one filter flag (run with --help for more information)\")\n\tErrInvalidRepository = errors.New(\"invalid repository format (expected owner/repo)\")\n\tErrRateLimited       = errors.New(\"GitHub API rate limit exceeded\")\n\tErrNotFound          = errors.New(\"resource not found\")\n\tErrUnauthorized      = errors.New(\"unauthorized: invalid or expired token\")\n\tErrForbidden         = errors.New(\"forbidden: insufficient permissions\")\n)\n```\nCommon errors\n\n## Functions\n\n```go\nfunc IsForbidden(err error) bool\n```\nIsForbidden checks if the error is a forbidden (403 permission-denied) error\n\n```go\nfunc IsNotFound(err error) bool\n```\nIsNotFound checks if the error is a not found error\n\n```go\nfunc IsRateLimited(err error) bool\n```\nIsRateLimited 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.\n\n```go\nfunc IsUnauthorized(err error) bool\n```\nIsUnauthorized checks if the error is an unauthorized (401) error\n\n## Types\n\n```go\ntype APIError struct {\n\tStatusCode int\n\tMessage    string\n\tErr        error\n}\n```\nAPIError represents a GitHub API error\n\n```go\nfunc NewAPIError(statusCode int, message string, err error) *APIError\n```\nNewAPIError creates a new API error\n\n```go\nfunc (e *APIError) Error() string\n```\n\n```go\nfunc (e *APIError) Unwrap() error\n```\n\n```go\ntype AuthError struct {\n\tMessage string\n}\n```\nAuthError represents an authentication error with helpful guidance\n\n```go\nfunc NewAuthError() *AuthError\n```\nNewAuthError creates a user-friendly authentication error\n\n```go\nfunc NewAuthErrorWithReason(reason string) *AuthError\n```\nNewAuthErrorWithReason creates a user-friendly authentication error that includes a specific reason\n\n```go\nfunc NewExpiredTokenError(source string) *AuthError\n```\nNewExpiredTokenError creates an auth error that identifies which token source failed\n\n```go\nfunc (e *AuthError) Error() string\n```\n\n```go\ntype ValidationError struct {\n\tField   string\n\tMessage string\n}\n```\nValidationError represents an input validation error\n\n```go\nfunc NewValidationError(field, message string) *ValidationError\n```\nNewValidationError creates a new validation error\n\n```go\nfunc (e *ValidationError) Error() string\n```\n\n","path":"github.com/Didstopia/githubby/internal/errors","name":"errors","synopsis":"Package errors provides custom error types for GitHubby","isRedistributable":true}
