The Errors type was deprecated in d3bafa5f3e,
which has been included in the 27.4.0 release.
This patch removes the type, as there are no external consumers.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
22 lines
465 B
Go
22 lines
465 B
Go
package cli
|
|
|
|
import (
|
|
"strconv"
|
|
)
|
|
|
|
// StatusError reports an unsuccessful exit by a command.
|
|
type StatusError struct {
|
|
Status string
|
|
StatusCode int
|
|
}
|
|
|
|
// Error formats the error for printing. If a custom Status is provided,
|
|
// it is returned as-is, otherwise it generates a generic error-message
|
|
// based on the StatusCode.
|
|
func (e StatusError) Error() string {
|
|
if e.Status == "" {
|
|
return "exit status " + strconv.Itoa(e.StatusCode)
|
|
}
|
|
return e.Status
|
|
}
|