errors

package
v1.1.61 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package errors provides error types for distinguishing between user errors and system errors, allowing commands to provide appropriate guidance.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsRetryable

func IsRetryable(err error) bool

IsRetryable returns true if the error is a retryable SystemError.

Types

type SystemError

type SystemError struct {
	Message   string
	Cause     error
	Retryable bool
}

SystemError represents an error caused by system issues (API failures, network problems, etc). May be temporary and retryable.

func NewSystemError

func NewSystemError(message string, cause error, retryable bool) SystemError

NewSystemError creates a new SystemError.

func (SystemError) Error

func (e SystemError) Error() string

func (SystemError) Unwrap

func (e SystemError) Unwrap() error

type UserError

type UserError struct {
	Message string
}

UserError represents an error caused by invalid user input or action. These errors are actionable - the user can fix them.

func NewUserError

func NewUserError(format string, args ...any) UserError

NewUserError creates a new UserError with the given message.

func (UserError) Error

func (e UserError) Error() string

Jump to

Keyboard shortcuts

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