clierr

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Failure        = 1
	Usage          = 2
	Canceled       = 3
	Authentication = 4
	// Unsuccessful reports a run that completed without success, unlike a Failure of gt itself.
	Unsuccessful = 5
	// HeadMismatch reports a run for another commit than gt run watch --expect-head names.
	HeadMismatch = 6
	// Pending reports checks that have not finished, like gh pr checks.
	Pending     = 8
	Interrupted = 130
)

Public exit codes for errors returned by commands.

Variables

This section is empty.

Functions

func ExitCode

func ExitCode(err error) int

ExitCode translates returned errors into the executable exit contract.

func IsQuiet

func IsQuiet(err error) bool

IsQuiet reports whether err is a Quiet exit code.

func Quiet

func Quiet(code int) error

Quiet exits with code without an error message, for an outcome the command already reported, such as failing checks.

func Wrap

func Wrap(code int, err error) error

Wrap preserves the underlying error while assigning an exit code.

Types

type Error

type Error struct {
	Code int
	Err  error
}

Error associates an operation error with a public CLI exit code.

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