clierr

package
v1.6.1-beta.1 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 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 ErrRateLimited = errors.New("rate limited")

Functions

This section is empty.

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"
)

Jump to

Keyboard shortcuts

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