Help us shape the future of Go! Take the 2026 Go Developer Survey

clierr

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: MPL-2.0 Imports: 4 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"`
	// 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"
)

Jump to

Keyboard shortcuts

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