Documentation ¶
Overview ¶
Package errdefs defines the error types that are understood by other packages in this project. Consumers of this project should look here to know how to produce and consume errors for this project.
Index ¶
- func AsInvalidInput(err error) error
- func AsNotFound(err error) error
- func AsUnavailableError(err error) error
- func InvalidInput(msg string) error
- func InvalidInputf(format string, args ...interface{}) error
- func IsInvalidInput(err error) bool
- func IsNotFound(err error) bool
- func IsUnavailable(err error) bool
- func NotFound(msg string) error
- func NotFoundf(format string, args ...interface{}) error
- func Unavailable(msg string) error
- func Unavailablef(format string, args ...interface{}) error
- type ErrInvalidInput
- type ErrNotFound
- type ErrUnavailable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AsInvalidInput ¶
AsInvalidInput wraps the passed in error to make it of type ErrInvalidInput
Callers should make sure the passed in error has exactly the error message it wants as this function does not decorate the message.
func AsNotFound ¶
AsNotFound wraps the passed in error to make it of type ErrNotFound
Callers should make sure the passed in error has exactly the error message it wants as this function does not decorate the message.
func AsUnavailableError ¶
AsUnavailable wraps the passed in error to make it of type ErrUnavailable
Callers should make sure the passed in error has exactly the error message it wants as this function does not decorate the message.
func InvalidInput ¶
InvalidInput makes an ErrInvalidInput from the provided error message.
func InvalidInputf ¶
InvalidInputf makes an ErrInvalidInput from the provided error format and args.
func IsInvalidInput ¶
IsInvalidInput determines if the passed in error is of type ErrInvalidInput
This will traverse the causal chain (`Cause() error`), until it finds an error which implements the `InvalidInput` interface.
func IsNotFound ¶
IsNotFound determines if the passed in error is of type ErrNotFound
This will traverse the causal chain (`Cause() error`), until it finds an error which implements the `NotFound` interface.
func IsUnavailable ¶
IsUnavailable determines if the passed in error is of type unavailableError
This will traverse the causal chain (`Cause() error`), until it finds an error which implements the `InvalidInput` interface.
func Unavailable ¶
InvalidInput makes an ErrInvalidInput from the provided error message.
func Unavailablef ¶
InvalidInputf makes an ErrInvalidInput from the provided error format and args.
Types ¶
type ErrInvalidInput ¶
ErrInvalidInput is an error interface which denotes whether the opration failed due to a the resource not being found.
type ErrNotFound ¶
NotFound is an error interface which denotes whether the opration failed due to a the resource not being found.
type ErrUnavailable ¶
type ErrUnavailable interface { error }
ErrUnavailable is an error interface which denotes whether the operation failed due to the unavailability of a resource.