Documentation ¶
Overview ¶
Package errdefs defines a set of error interfaces that packages should use for communicating classes of errors. Errors that cross the package boundary should implement one (and only one) of these interfaces.
Packages should not reference these interfaces directly, only implement them. To check if a particular error implements one of these interfaces, there are helper functions provided (e.g. `Is<SomeError>`) which can be used rather than asserting the interfaces directly. If you must assert on these interfaces, be sure to check the causal chain (`err.Cause()`).
Index ¶
- func IsConflict(err error) bool
- func IsForbidden(err error) bool
- func IsInvalidParameter(err error) bool
- func IsNotFound(err error) bool
- func IsNotImplemented(err error) bool
- func IsNotModified(err error) bool
- func IsSystem(err error) bool
- func IsUnauthorized(err error) bool
- func IsUnavailable(err error) bool
- func IsUnknown(err error) bool
- type ErrConflict
- type ErrForbidden
- type ErrInvalidParameter
- type ErrNotFound
- type ErrNotImplemented
- type ErrNotModified
- type ErrSystem
- type ErrUnauthorized
- type ErrUnavailable
- type ErrUnknown
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsConflict ¶
IsConflict returns if the passed in error is an ErrConflict
func IsForbidden ¶
IsForbidden returns if the passed in error is an ErrForbidden
func IsInvalidParameter ¶
IsInvalidParameter returns if the passed in error is an ErrInvalidParameter
func IsNotFound ¶
IsNotFound returns if the passed in error is an ErrNotFound
func IsNotImplemented ¶
IsNotImplemented returns if the passed in error is an ErrNotImplemented
func IsNotModified ¶
IsNotModified returns if the passed in error is a NotModified error
func IsUnauthorized ¶
IsUnauthorized returns if the the passed in error is an ErrUnauthorized
func IsUnavailable ¶
IsUnavailable returns if the passed in error is an ErrUnavailable
Types ¶
type ErrConflict ¶
type ErrConflict interface {
Conflict()
}
ErrConflict signals that some internal state conflicts with the requested action and can't be performed. A change in state should be able to clear this error.
type ErrForbidden ¶
type ErrForbidden interface {
Forbidden()
}
ErrForbidden signals that the requested action cannot be performed under any circumstances. When a ErrForbidden is returned, the caller should never retry the action.
type ErrInvalidParameter ¶
type ErrInvalidParameter interface {
InvalidParameter()
}
ErrInvalidParameter signals that the user input is invalid
type ErrNotFound ¶
type ErrNotFound interface {
NotFound()
}
ErrNotFound signals that the requested object doesn't exist
type ErrNotImplemented ¶
type ErrNotImplemented interface {
NotImplemented()
}
ErrNotImplemented signals that the requested action/feature is not implemented on the system as configured.
type ErrNotModified ¶
type ErrNotModified interface {
NotModified()
}
ErrNotModified signals that an action can't be performed because it's already in the desired state
type ErrSystem ¶
type ErrSystem interface {
ErrSystem()
}
ErrSystem signals that some internal error occurred. An example of this would be a failed mount request.
type ErrUnauthorized ¶
type ErrUnauthorized interface {
}ErrUnauthorized is used to signify that the user is not authorized to perform a specific action
type ErrUnavailable ¶
type ErrUnavailable interface {
}ErrUnavailable signals that the requested action/subsystem is not available.
type ErrUnknown ¶
type ErrUnknown interface {
Unknown()
}
ErrUnknown signals that the kind of error that occurred is not known.