exitcode

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2026 License: GPL-3.0, LGPL-3.0 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 defines the process exit codes clusterctl guarantees.

The codes are part of the command line contract: scripts branch on them, so they may be added to but never renumbered.

Index

Constants

View Source
const (
	// OK means every target succeeded.
	OK = 0
	// TargetFailed means clusterctl ran correctly but at least one target
	// reported a failure.
	TargetFailed = 1
	// Usage means the command line or the configuration was rejected before
	// anything was contacted.
	Usage = 2
	// Transport means a host could not be reached, authenticated with, or
	// stayed reachable for the duration of the command.
	Transport = 3
	// Interrupted means the command was cancelled, by a signal or by a
	// declined confirmation prompt.
	Interrupted = 130
)

Variables

This section is empty.

Functions

func From

func From(err error) int

From reports the exit code an error should produce. Errors that carry no code of their own count as a target failure.

func Wrap

func Wrap(code int, err error) error

Wrap attaches an exit code to an existing error, returning nil for nil.

Types

type Error

type Error struct {
	Code int
	Err  error
}

Error carries an exit code alongside an error. Commands return it to select an exit code other than TargetFailed.

func Errorf

func Errorf(code int, format string, args ...any) *Error

Errorf builds an Error with a formatted message.

func (*Error) Error

func (e *Error) Error() string

func (*Error) Unwrap

func (e *Error) Unwrap() error

Jump to

Keyboard shortcuts

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