errors

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 3, 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 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

Constants

This section is empty.

Variables

View Source
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

func NewForbiddenError(reason string, cause error) error

NewForbiddenError returns a *ForbiddenError tagged with a short machine-readable reason code.

func NewInputError

func NewInputError(field string, cause error) error

NewInputError returns an *InputError describing a malformed or unexpected input value.

func NewNotFoundError

func NewNotFoundError(resource string, cause error) error

NewNotFoundError returns a *NotFoundError keyed by the missing resource identifier.

func NewRetryableError

func NewRetryableError(cause error) error

NewRetryableError wraps a transient failure that callers should retry. Also used by the plugin runner when a panic is recovered.

func NewUnsupportedFormatError

func NewUnsupportedFormatError(format string, cause error) error

NewUnsupportedFormatError returns an *UnsupportedFormatError tagged with the unsupported format string.

Types

type ForbiddenError

type ForbiddenError struct {
	Reason string
	Cause  error
}

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

type InputError struct {
	Field string
	Cause error
}

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

type NotFoundError struct {
	Resource string
	Cause    error
}

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

type UnsupportedFormatError struct {
	Format string
	Cause  error
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL