Documentation
¶
Index ¶
- func Is(err error, target error) bool
- func IsAlreadyExists(err error) bool
- func IsForbidden(err error) bool
- func IsInvalidArgument(err error) bool
- func IsNotFound(err error) bool
- func IsUnauthorized(err error) bool
- func New(msg string) error
- func Wrap(code ErrCode, msg string) error
- func Wrapf(code ErrCode, format string, v ...any) error
- type ErrCode
- type Error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsAlreadyExists ¶
IsAlreadyExists returns true if err item already exists in the space
func IsForbidden ¶
IsForbidden returns true if err is due to Forbidden action
func IsInvalidArgument ¶
IsInvalidArgument returns true if err item is invalid argument
func IsNotFound ¶
IsNotFound returns true if err item isn't found in the space
func IsUnauthorized ¶
IsUnauthorized returns true if err is due to Unauthorized request
Types ¶
type ErrCode ¶
type ErrCode int
ErrCode is type for multiple reconizable errors.
const ( // if error is unknown Unknown ErrCode = 0 // if the item not found in the space NotFound ErrCode = 1 // if the item already present in the space AlreadyExists ErrCode = 2 // if the argument is not valid InvalidArgument ErrCode = 3 Unauthorized ErrCode = 4 // Forbidden action error Forbidden ErrCode = 5 )
error codes
func GetErrCode ¶
get the error code if the error is associated to recognizable error types
Click to show internal directories.
Click to hide internal directories.