Documentation
¶
Overview ¶
Package errors defines the CLI's typed error surface and maps errors to documented exit codes.
Index ¶
Constants ¶
const ( CodeOK = 0 CodeGeneric = 1 CodeUsage = 2 CodeAuth = 3 CodeNetwork = 4 CodePartial = 5 CodeNoInput = 66 CodeCantCreat = 73 CodeConfig = 78 )
Exit codes — the authoritative surface documented in specs/001-readur-upload-cli/contracts/exit-codes.md. Scripts consume these values; changing any of them is a breaking change per the constitution's versioning policy.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CLIError ¶
type CLIError struct {
Code int // one of the Code* constants in codes.go
Message string // human-readable, free of stack traces
Cause error // wrapped underlying error (optional)
}
CLIError carries an exit-code category plus a user-facing message. The command layer returns a CLIError (or wraps one) and main.go runs it through Classify to select the process exit code.
func New ¶
New constructs a CLIError with the given code, message, and optional cause. The cause may be nil.
func Wrap ¶
Wrap promotes an existing error to a CLIError with the provided code and message. If err is already a *CLIError, its Code is preserved unless overrideCode is true.