Documentation
¶
Overview ¶
Package exitcode defines the hadron CLI's stable, documented exit codes. These are part of the public contract (D8): agents and scripts branch on them, so values must never be repurposed.
Index ¶
Constants ¶
View Source
const ( OK = 0 // success Error = 1 // generic failure Usage = 2 // invalid usage: bad flags, bad input, not-yet-implemented AuthRequired = 3 // no credentials, or credentials rejected NotFound = 4 // requested entity does not exist (or is not visible) Conflict = 5 // state conflict, e.g. duplicate install Cancelled = 6 // interrupted or timed out waiting for the user )
Variables ¶
View Source
var ErrSilent = errors.New("silent")
ErrSilent marks an error whose message has already been rendered by the command; the root handler sets the exit code but prints nothing further.
Functions ¶
Types ¶
type CodedError ¶
CodedError carries an exit code alongside an error. The root command unwraps it to decide the process exit code.
func Newf ¶
func Newf(code int, format string, args ...any) *CodedError
Newf creates a CodedError from a format string.
func Silent ¶
func Silent(code int) *CodedError
Silent returns a CodedError that only carries an exit code.
func (*CodedError) Error ¶
func (e *CodedError) Error() string
func (*CodedError) Unwrap ¶
func (e *CodedError) Unwrap() error
Click to show internal directories.
Click to hide internal directories.