exitcode

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 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

	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.

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