apierr

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	Code       string
	Message    string
	Hint       string
	HTTPStatus int
	Retryable  bool
	Cause      error
}

Error is a typed error carrying a machine-readable code, human message, optional hint, and metadata used for retry and exit-code decisions.

func AsError

func AsError(err error) *Error

func ErrAPI

func ErrAPI(status int, msg string) *Error

func ErrAmbiguous

func ErrAmbiguous(resource string, matches []string) *Error

func ErrAuth

func ErrAuth(msg string) *Error

func ErrForbidden

func ErrForbidden(msg string) *Error

func ErrNetwork

func ErrNetwork(cause error) *Error

func ErrNotFound

func ErrNotFound(resource, identifier string) *Error

func ErrRateLimit

func ErrRateLimit(retryAfter int) *Error

func ErrUsage

func ErrUsage(msg string) *Error

func ErrUsageHint

func ErrUsageHint(msg, hint string) *Error

func (*Error) Error

func (e *Error) Error() string

func (*Error) Unwrap

func (e *Error) Unwrap() error

Jump to

Keyboard shortcuts

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