Documentation ¶
Index ¶
Constants ¶
View Source
const ( // ExitCodeSuccess indicates no errors or failures had occurred. ExitCodeSuccess = 0 // ExitCodeGeneralError indicates some type of general error occurred. ExitCodeGeneralError = 1 // ExitCodeTestFailed indicates a test case had failed. ExitCodeTestFailed = 7 )
Variables ¶
This section is empty.
Functions ¶
func GetErrorExitCode ¶
GetErrorExitCode checks the given exit code that the application should exit with, if this error is bubbled to the top-level. This will be 0 for a nil error, 1 for a generic error, or arbitrary if the error is of type ErrorWithExitCode. Returns the exit code associated with the error.
Types ¶
type ErrorWithExitCode ¶
type ErrorWithExitCode struct {
// contains filtered or unexported fields
}
ErrorWithExitCode is an `error` type that wraps an existing error and exit code, providing exit codes for a given error if they are bubbled up to the top-level.
func NewErrorWithExitCode ¶
func NewErrorWithExitCode(err error, exitCode int) *ErrorWithExitCode
NewErrorWithExitCode creates a new error (ErrorWithExitCode) with the provided internal error and exit code.
func (*ErrorWithExitCode) Error ¶
func (e *ErrorWithExitCode) Error() string
Error returns the error message string, implementing the `error` interface.
Click to show internal directories.
Click to hide internal directories.