exitcode

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 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 fft's process exit codes.

The codes are documented for scripts and agents in the skill's troubleshooting reference (internal/skill/assets/references/troubleshooting.md), which the docs site publishes as the Troubleshooting guide.

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)

	// ReadOnly is a write refused against a read-only project. It is not a
	// Forbidden: a 403 means the tenant said no, and this means fft did. Nothing
	// left the machine, so a script that retries a 5 with other credentials must
	// not retry this one.
	ReadOnly = 10

	// ProblemsFound is a check that ran to the end and found what it looks for:
	// `fft network check` reporting gaps. The command worked; its answer is "no".
	// A CI job gates on it, and must be able to tell it from a check that could not
	// run at all, which exits with that failure's own code.
	ProblemsFound = 11

	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. A cancellation is an interrupt whatever wraps it; errors that implement ExitCode() decide for themselves; an expired deadline is the upstream not answering in time; everything else is a general failure.

The deadline comes after the explicit code so that an error that names its own (a sign-in that timed out is still a 4) is never overruled by the cause inside it.

func Meaning added in v0.8.0

func Meaning(code int) string

Meaning describes code in a few words, for a person reading a result rather than a script branching on it. A code fft never exits with is described as unknown.

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