Documentation
¶
Overview ¶
Package errors defines the typed error model for the github-metrics project. Each type carries one structured field describing the source of the problem (input name, missing resource, denied reason, ...) so that callers can branch with errors.As without parsing strings.
Index ¶
- Variables
- func NewForbiddenError(reason string, cause error) error
- func NewInputError(field string, cause error) error
- func NewNotFoundError(resource string, cause error) error
- func NewRetryableError(cause error) error
- func NewUnsupportedFormatError(format string, cause error) error
- type ForbiddenError
- type InputError
- type NotFoundError
- type RetryableError
- type UnsupportedFormatError
Constants ¶
This section is empty.
Variables ¶
var ( Is = errors.Is As = errors.As )
Re-export the standard library helpers so callers can rely on a single import for typed-error handling.
Functions ¶
func NewForbiddenError ¶
NewForbiddenError returns a *ForbiddenError tagged with a short machine-readable reason code.
func NewInputError ¶
NewInputError returns an *InputError describing a malformed or unexpected input value.
func NewNotFoundError ¶
NewNotFoundError returns a *NotFoundError keyed by the missing resource identifier.
func NewRetryableError ¶
NewRetryableError wraps a transient failure that callers should retry. Also used by the plugin runner when a panic is recovered.
func NewUnsupportedFormatError ¶
NewUnsupportedFormatError returns an *UnsupportedFormatError tagged with the unsupported format string.
Types ¶
type ForbiddenError ¶
ForbiddenError reports that the operation is denied (auth scope, allow-list, rate exhaustion, ...). Reason carries a short machine-readable code.
func (*ForbiddenError) Error ¶
func (e *ForbiddenError) Error() string
func (*ForbiddenError) Unwrap ¶
func (e *ForbiddenError) Unwrap() error
type InputError ¶
InputError reports that an input value failed validation or could not be normalized. Field identifies which input (typically the metadata.yml key).
func (*InputError) Error ¶
func (e *InputError) Error() string
func (*InputError) Unwrap ¶
func (e *InputError) Unwrap() error
type NotFoundError ¶
NotFoundError reports that a requested resource (login, template, plugin) was not present.
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
func (*NotFoundError) Unwrap ¶
func (e *NotFoundError) Unwrap() error
type RetryableError ¶
type RetryableError struct {
Cause error
}
RetryableError wraps a transient failure that callers should retry (or that the plugin runner has already recovered from a panic).
func (*RetryableError) Error ¶
func (e *RetryableError) Error() string
func (*RetryableError) Unwrap ¶
func (e *RetryableError) Unwrap() error
type UnsupportedFormatError ¶
UnsupportedFormatError reports that a requested rendering or input format is not supported by the active template / plugin.
func (*UnsupportedFormatError) Error ¶
func (e *UnsupportedFormatError) Error() string
func (*UnsupportedFormatError) Unwrap ¶
func (e *UnsupportedFormatError) Unwrap() error