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

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