Documentation ¶
Index ¶
- func ExitWithErr(msg interface{})
- func InvalidInstanceError(obj interface{}) error
- func InvalidInstanceErrorf(obj interface{}, msgFormat string, args ...interface{}) error
- func InvalidValueErrorf(val interface{}, msgFormat string, args ...interface{}) error
- func InvalidValueForTypeError(val, typedObj interface{}) error
- func InvalidValueForTypeErrorf(val, typedObj interface{}, msgFormat string, args ...interface{}) error
- func PrettyError(err error) string
- func ReversedStringsList(stringsList []string) []string
- func SetVerboseErrors(verbose bool)
- func TypeError(obj interface{}) error
- func TypeErrorf(obj interface{}, msgFormat string, args ...interface{}) error
- func UsageErrorf(commandPath, f interface{}, args ...interface{}) error
- type ErrorWithContext
- func ContextualizeErrorf(err error, contextFormat string, contextArgs ...interface{}) *ErrorWithContext
- func InvalidInstanceContextErrorf(baseError error, obj interface{}, msgFormat string, args ...interface{}) *ErrorWithContext
- func InvalidValueContextErrorf(baseError error, val interface{}, msgFormat string, args ...interface{}) *ErrorWithContext
- func InvalidValueForTypeContextError(baseError error, val, typedObj interface{}) *ErrorWithContext
- func InvalidValueForTypeContextErrorf(baseError error, val, typedObj interface{}, msgFormat string, ...) *ErrorWithContext
- func TypeContextErrorf(baseError error, obj interface{}, msgFormat string, args ...interface{}) *ErrorWithContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExitWithErr ¶
func ExitWithErr(msg interface{})
func InvalidInstanceError ¶
func InvalidInstanceError(obj interface{}) error
InvalidInstanceError means that obj is the correct type, but there's something wrong with its contents.
func InvalidInstanceErrorf ¶
InvalidInstanceErrorf is like InvalidInstanceError, except with a custom message.
func InvalidValueErrorf ¶
InvalidValueErrorf is used when the type isn't meaningful--just the contents and the context matter.
func InvalidValueForTypeError ¶
func InvalidValueForTypeError(val, typedObj interface{}) error
InvalidValueForTypeError is used when the type isn't meaningful--just the contents and the context matter.
func InvalidValueForTypeErrorf ¶
func InvalidValueForTypeErrorf(val, typedObj interface{}, msgFormat string, args ...interface{}) error
InvalidValueForTypeErrorf is used when the type isn't meaningful--just the contents and the context matter.
func PrettyError ¶
func ReversedStringsList ¶
func SetVerboseErrors ¶
func SetVerboseErrors(verbose bool)
func TypeError ¶
func TypeError(obj interface{}) error
TypeError means that obj has an unexpected type.
func TypeErrorf ¶
TypeErrorf is like TypeError, except with a custom message.
func UsageErrorf ¶
func UsageErrorf(commandPath, f interface{}, args ...interface{}) error
Types ¶
type ErrorWithContext ¶
func ContextualizeErrorf ¶
func ContextualizeErrorf(err error, contextFormat string, contextArgs ...interface{}) *ErrorWithContext
ContextualizeErrorf is for adding an additional message to an existing error. This method is only intended for simple messages (contextFormat). e.g. If the context includes a printout of a Go struct, use one of the other error generators in this package.
func InvalidInstanceContextErrorf ¶
func InvalidInstanceContextErrorf(baseError error, obj interface{}, msgFormat string, args ...interface{}) *ErrorWithContext
InvalidInstanceContextErrorf is like InvalidInstanceContextErrorf, except it adds its message as context to an existing error.
func InvalidValueContextErrorf ¶
func InvalidValueContextErrorf(baseError error, val interface{}, msgFormat string, args ...interface{}) *ErrorWithContext
func InvalidValueForTypeContextError ¶
func InvalidValueForTypeContextError(baseError error, val, typedObj interface{}) *ErrorWithContext
func InvalidValueForTypeContextErrorf ¶
func InvalidValueForTypeContextErrorf(baseError error, val, typedObj interface{}, msgFormat string, args ...interface{}) *ErrorWithContext
func TypeContextErrorf ¶
func TypeContextErrorf(baseError error, obj interface{}, msgFormat string, args ...interface{}) *ErrorWithContext
TypeContextErrorf is like TypeErrorf, but it adds its message as context to an existing error.
func (*ErrorWithContext) Error ¶
func (e *ErrorWithContext) Error() string
func (*ErrorWithContext) PrettyError ¶
func (e *ErrorWithContext) PrettyError() string