Documentation
¶
Overview ¶
Package clierr defines the error kinds commands return and the stable exit codes they map to. The codes follow gh and are a compatibility contract: 0 success, 1 failure (including usage errors), 2 cancelled, 4 auth required.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrCancel = errors.New("cancelled")
ErrCancel signals that the user cancelled an interactive prompt.
var ErrSilent = errors.New("silent error")
ErrSilent fails the command with exit 1 after the command already printed its own diagnostics.
Functions ¶
func AuthErrorWrap ¶
AuthErrorWrap marks err as an authentication error.
func AuthErrorf ¶
AuthErrorf returns an authentication error.
func FlagErrorf ¶
FlagErrorf returns a usage error.
Types ¶
type AuthError ¶
type AuthError struct {
// contains filtered or unexported fields
}
AuthError means the command needs credentials it does not have or that were rejected.
type FlagError ¶
type FlagError struct {
// contains filtered or unexported fields
}
FlagError is a usage error: bad flags, arguments or flag combinations. It exits 1 like any failure; it differs only in printing a --help hint.
type StatusCoder ¶
StatusCoder is implemented by API errors that carry an HTTP status.