exitcode

package
v0.1.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: MIT Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package exitcode maps errors to the process exit codes documented in `fft help exit-codes`.

Index

Constants

View Source
const (
	OK          = 0 // success
	General     = 1 // unclassified failure
	Usage       = 2 // bad flags or arguments
	Config      = 3 // no active project, or the config is unusable
	Auth        = 4 // authentication failed (401)
	Forbidden   = 5 // authenticated but not permitted (403)
	NotFound    = 6 // the resource does not exist (404)
	Conflict    = 7 // optimistic-locking version conflict (409)
	Partial     = 8 // a bulk operation succeeded for some items and failed for others
	Unavailable = 9 // upstream is unreachable or erroring (5xx, timeout)
	Interrupted = 130
)

Exit codes. These are part of the CLI's contract with scripts — changing one is a breaking change.

Variables

This section is empty.

Functions

func FromError

func FromError(err error) int

FromError classifies an error into an exit code. Errors that implement ExitCode() decide for themselves; everything else is a general failure.

Types

type UsageError

type UsageError struct{ Err error }

UsageError marks an error as a usage problem so cobra's argument and flag validation surfaces as exit code 2 rather than a generic failure.

func (UsageError) Error

func (e UsageError) Error() string

func (UsageError) ExitCode

func (e UsageError) ExitCode() int

func (UsageError) Unwrap

func (e UsageError) Unwrap() error

Jump to

Keyboard shortcuts

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