errs

package
v0.1.0-beta.3 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: Apache-2.0 Imports: 4 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

func Code

func Code(err error) string

func ExitCode

func ExitCode(err error) int

func New

func New(code, message string, exitCode int) error

func NewOperation

func NewOperation(code, message, state string, exitCode int) error

func RawProblem

func RawProblem(err error) json.RawMessage

func Redact

func Redact(value string) string

Redact replaces any embedded credential with a fixed marker. Every package that turns a transport, gateway, or file error into user-visible text passes it through here so a token can never reach stdout, stderr, or a JSON report.

Types

type APIError

type APIError struct {
	Status         int                 `json:"status"`
	Code           string              `json:"code"`
	Detail         string              `json:"detail"`
	Message        string              `json:"message"`
	Errors         map[string][]string `json:"errors"`
	Meta           map[string]any      `json:"meta"`
	RequestID      string              `json:"request_id"`
	RetryAfter     string              `json:"-"`
	Class          Class               `json:"-"`
	OperationState string              `json:"-"`
	Raw            json.RawMessage     `json:"-"`
}

func (*APIError) Error

func (e *APIError) Error() string

type CLIError

type CLIError struct {
	Code           string
	Message        string
	Class          Class
	ExitCode       int
	RequestID      string
	RetryAfter     string
	OperationState string
}

func (*CLIError) Error

func (e *CLIError) Error() string

type Class

type Class string
const (
	ClassFailure      Class = "failure"
	ClassUsage        Class = "usage"
	ClassAuth         Class = "authentication"
	ClassNotFound     Class = "not_found"
	ClassDenied       Class = "denied"
	ClassConfirmation Class = "confirmation_required"
	ClassRateQuota    Class = "rate_or_quota"
	ClassUnknown      Class = "outcome_unknown"
)

Jump to

Keyboard shortcuts

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