Documentation
¶
Index ¶
Constants ¶
View Source
const ( ExitOK = 0 ExitGeneral = 1 ExitAuth = 2 ExitNotFound = 3 ExitValidation = 4 ExitAPI = 5 ExitNetwork = 6 ExitCancelled = 10 )
Variables ¶
This section is empty.
Functions ¶
func GetExitCode ¶
GetExitCode returns the exit code for the given error. If the error implements the ExitCoder interface its code is returned; otherwise ExitGeneral is returned.
Types ¶
type AuthError ¶
type AuthError struct {
Message string
}
AuthError represents an authentication or authorization failure.
type ConfigError ¶
type ConfigError struct {
Message string
}
ConfigError represents a configuration problem.
func (*ConfigError) Error ¶
func (e *ConfigError) Error() string
func (*ConfigError) ExitCode ¶
func (e *ConfigError) ExitCode() int
type ExitCoder ¶
type ExitCoder interface {
ExitCode() int
}
ExitCoder is implemented by errors that carry a process exit code.
type NetworkError ¶
type NetworkError struct {
Err error
}
NetworkError wraps an underlying network-level error.
func (*NetworkError) Error ¶
func (e *NetworkError) Error() string
func (*NetworkError) ExitCode ¶
func (e *NetworkError) ExitCode() int
func (*NetworkError) Unwrap ¶
func (e *NetworkError) Unwrap() error
type NotFoundError ¶
NotFoundError indicates that a requested resource was not found.
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
func (*NotFoundError) ExitCode ¶
func (e *NotFoundError) ExitCode() int
type ValidationError ¶
ValidationError represents invalid user input.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
func (*ValidationError) ExitCode ¶
func (e *ValidationError) ExitCode() int
Click to show internal directories.
Click to hide internal directories.