errors

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExitOK = iota
	ExitGeneral
	ExitUsage
	ExitNotFound
	ExitPerm
	ExitConflict
	ExitNetwork
	ExitUnavailable
	ExitValid
	ExitCanceled
	ExitPartial
)

Variables

View Source
var ErrPartialSuccess = stderrors.New("partial success")

Functions

func ExitCode

func ExitCode(err error) int

func Wrap

func Wrap(err error, code string, exit int, opts ...Option) error

Types

type Error

type Error struct {
	Code        string `json:"code"`
	Message     string `json:"message"`
	Retryable   bool   `json:"retryable"`
	Remediation string `json:"remediation,omitempty"`
	Resource    string `json:"resource,omitempty"`
	Exit        int    `json:"exit_code,omitempty"`
	Rendered    bool   `json:"-"`
	// contains filtered or unexported fields
}

func (*Error) Error

func (e *Error) Error() string

func (*Error) Unwrap

func (e *Error) Unwrap() error

type Option

type Option func(*Error)

func WithMessage

func WithMessage(message string) Option

func WithRemediation

func WithRemediation(remediation string) Option

func WithRendered

func WithRendered(rendered bool) Option

func WithResource

func WithResource(resource string) Option

func WithRetryable

func WithRetryable(retryable bool) Option

Jump to

Keyboard shortcuts

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