Documentation
¶
Overview ¶
Package errors provides error types and translation utilities for GitHub API errors.
Index ¶
- Variables
- func IsConflict(err error) bool
- func IsNotFound(err error) bool
- func IsPermissionDenied(err error) bool
- func IsRateLimited(err error) bool
- func IsServerError(err error) bool
- func IsValidation(err error) bool
- func StatusCode(err error) int
- func Translate(err error, resp *github.Response) error
- type APIError
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotFound indicates that the requested resource was not found. ErrNotFound = errors.New("not found") // ErrPermissionDenied indicates insufficient permissions for the operation. ErrPermissionDenied = errors.New("permission denied") // ErrRateLimited indicates the API rate limit has been exceeded. ErrRateLimited = errors.New("rate limit exceeded") // ErrConflict indicates a conflict (e.g., resource already exists). ErrConflict = errors.New("conflict") // ErrValidation indicates a validation error in the request. ErrValidation = errors.New("validation failed") // ErrServerError indicates a GitHub server error. ErrServerError = errors.New("server error") )
Standard errors for GitHub operations.
Functions ¶
func IsConflict ¶
IsConflict returns true if the error indicates a conflict.
func IsNotFound ¶
IsNotFound returns true if the error indicates a not found condition.
func IsPermissionDenied ¶
IsPermissionDenied returns true if the error indicates a permission issue.
func IsRateLimited ¶
IsRateLimited returns true if the error indicates rate limiting.
func IsServerError ¶
IsServerError returns true if the error indicates a server error.
func IsValidation ¶
IsValidation returns true if the error indicates a validation failure.
func StatusCode ¶
StatusCode extracts the HTTP status code from an error, if available. Returns 0 if the status code cannot be determined.
Types ¶
Click to show internal directories.
Click to hide internal directories.