Documentation
¶
Overview ¶
Package exitcode defines the CLI's stable process exit codes and a typed error that carries the intended code, so the mapping lives in exactly one place (unwrapped once in cmd/vibexp/main.go).
Index ¶
Constants ¶
const ( OK = 0 // success RuntimeErr = 1 // API or runtime error UsageErr = 2 // invalid usage (bad flags/args) AuthErr = 4 // authentication/authorization failure )
Stable exit codes. These are part of the CLI's scripting contract — do not renumber. Documented in docs/architecture.md.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CodedError ¶
CodedError wraps an error with the process exit code it should produce.
func Auth ¶
func Auth(format string, args ...any) *CodedError
Auth is a convenience constructor for auth (exit 4) errors.
func Newf ¶
func Newf(code int, format string, args ...any) *CodedError
Newf wraps a formatted message with the given exit code.
func Usage ¶
func Usage(format string, args ...any) *CodedError
Usage is a convenience constructor for usage (exit 2) errors.
func (*CodedError) Error ¶
func (e *CodedError) Error() string
func (*CodedError) ExitCode ¶
func (e *CodedError) ExitCode() int
ExitCode reports the process exit code, satisfying ExitCoder.
func (*CodedError) Unwrap ¶
func (e *CodedError) Unwrap() error
Unwrap exposes the wrapped error to errors.Is / errors.As.