clierr

package
v1.20.0-beta.16 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2026 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package clierr classifies CLI errors into stable codes.

Index

Constants

This section is empty.

Variables

View Source
var ErrBuildFailedRecoverable = errors.New("dev container build failed")
View Source
var ErrRateLimited = errors.New("rate limited")

Functions

func Recoverable added in v1.11.0

func Recoverable(err error) error

Types

type CLIError

type CLIError struct {
	Code    Code              `json:"code"`
	Message string            `json:"message"`
	Hint    string            `json:"hint,omitempty"`
	Context map[string]string `json:"context,omitempty"`
	// contains filtered or unexported fields
}

func Classify

func Classify(err error) *CLIError

func NewPanic

func NewPanic(recovered any) *CLIError

func (*CLIError) Error

func (e *CLIError) Error() string

func (*CLIError) MarshalJSON

func (e *CLIError) MarshalJSON() ([]byte, error)

func (*CLIError) MarshalLogObject

func (e *CLIError) MarshalLogObject(enc zapcore.ObjectEncoder) error

func (*CLIError) Unwrap

func (e *CLIError) Unwrap() error

type Code

type Code string
const (
	CodeRateLimited              Code = "RATE_LIMITED"
	CodePanic                    Code = "PANIC"
	CodeUnknown                  Code = "UNKNOWN"
	CodeBuildFailedRecoverable   Code = "BUILD_FAILED_RECOVERABLE"
	CodeDockerDaemonUnreachable  Code = "docker_daemon_unreachable"
	CodeCanceled                 Code = "canceled"
	CodeDeadlineExceeded         Code = "deadline_exceeded"
	CodeUnlockRequired           Code = "unlock_required"
	CodeUnlockFailed             Code = "unlock_failed"
	CodeSecretBackendUnavailable Code = "secret_backend_unavailable"
	CodeSecretStoreCorrupt       Code = "secret_store_corrupt"
	CodeSecretNotFound           Code = "secret_not_found"
)

Jump to

Keyboard shortcuts

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