Documentation ¶
Index ¶
- func FromHeader(header *headers.ResponseHeader) error
- func IsAlreadyExists(err error) bool
- func IsCanceled(err error) bool
- func IsConflict(err error) bool
- func IsForbidden(err error) bool
- func IsInternal(err error) bool
- func IsInvalid(err error) bool
- func IsNotFound(err error) bool
- func IsNotSupported(err error) bool
- func IsTimeout(err error) bool
- func IsType(err error, t Type) bool
- func IsUnauthorized(err error) bool
- func IsUnavailable(err error) bool
- func IsUnknown(err error) bool
- func New(t Type, msg string, args ...interface{}) error
- func NewAlreadyExists(msg string) error
- func NewCanceled(msg string) error
- func NewConflict(msg string) error
- func NewForbidden(msg string) error
- func NewInternal(msg string) error
- func NewInvalid(msg string) error
- func NewNotFound(msg string) error
- func NewNotSupported(msg string) error
- func NewTimeout(msg string) error
- func NewUnauthorized(msg string) error
- func NewUnavailable(msg string) error
- func NewUnknown(msg string) error
- type Type
- type TypedError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromHeader ¶
func FromHeader(header *headers.ResponseHeader) error
FromHeader creates a typed error from a response header
func IsAlreadyExists ¶
IsAlreadyExists checks whether the given error is a AlreadyExists error
func IsCanceled ¶
IsCanceled checks whether the given error is an Canceled error
func IsConflict ¶
IsConflict checks whether the given error is a Conflict error
func IsForbidden ¶
IsForbidden checks whether the given error is a Forbidden error
func IsInternal ¶
IsInternal checks whether the given error is an Internal error
func IsNotFound ¶
IsNotFound checks whether the given error is a NotFound error
func IsNotSupported ¶
IsNotSupported checks whether the given error is a NotSupported error
func IsUnauthorized ¶
IsUnauthorized checks whether the given error is a Unauthorized error
func IsUnavailable ¶
IsUnavailable checks whether the given error is an Unavailable error
func NewAlreadyExists ¶
NewAlreadyExists returns a new AlreadyExists error
func NewNotSupported ¶
NewNotSupported returns a new NotSupported error
func NewUnauthorized ¶
NewUnauthorized returns a new Unauthorized error
func NewUnavailable ¶
NewUnavailable returns a new Unavailable error
Types ¶
type Type ¶
type Type int
Type is an error type
const ( // Unknown is an unknown error type Unknown Type = iota // Canceled indicates a request context was canceled Canceled // NotFound indicates a resource was not found NotFound // AlreadyExists indicates a resource already exists AlreadyExists Unauthorized // Forbidden indicates the operation requested to be performed on a resource is forbidden Forbidden // Conflict indicates a conflict occurred during concurrent modifications to a resource Conflict // Invalid indicates a message or request is invalid Invalid Unavailable // NotSupported indicates a method is not supported NotSupported // Timeout indicates a request timed out Timeout // Internal indicates an unexpected internal error occurred Internal )
type TypedError ¶
type TypedError struct { // Type is the error type Type Type // Message is the error message Message string }
TypedError is an typed error
func (*TypedError) Error ¶
func (e *TypedError) Error() string