exitcode

package
v0.3.68 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package exitcode centralizes cr's command-layer process exit taxonomy.

Index

Constants

View Source
const (
	// Success means the program completed successfully.
	Success = 0
	// Failure is the generic non-usage failure code.
	Failure = 1
	// UsageError means command syntax, flags, or arguments were invalid.
	UsageError = 2
	// AuthConfigError means authentication or configuration prevented execution.
	AuthConfigError = 3
	// UpstreamError means an upstream service or network failure prevented execution.
	UpstreamError = 5
)

Variables

This section is empty.

Functions

func AuthConfig

func AuthConfig(err error) error

AuthConfig marks err as an authentication or configuration error.

func FromError

func FromError(err error) int

FromError maps an error to cr's process exit taxonomy.

func Upstream

func Upstream(err error) error

Upstream marks err as an upstream or network error.

func Usage

func Usage(err error) error

Usage marks err as a usage error.

func With

func With(code int, err error) error

With wraps err with an explicit process exit code. Nil stays nil so callers can safely write `return exitcode.With(..., err)`.

Types

This section is empty.

Jump to

Keyboard shortcuts

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