Documentation
¶
Index ¶
- Variables
- func BadRequest(err error, opts ...Option) error
- func DBError(err error, opts ...Option) error
- func Forbidden(err error, opts ...Option) error
- func InternalServerError(err error, opts ...Option) error
- func Is(err error, code int32) bool
- func IsBadRequest(err error) bool
- func IsDBError(err error) bool
- func IsForbidden(err error) bool
- func IsInternalServerError(err error) bool
- func IsNetworkError(err error) bool
- func IsNotFound(err error) bool
- func IsTimeout(err error) bool
- func Msg(err error) string
- func NetworkError(err error, opts ...Option) error
- func New(text string) error
- func NewF(text string, params ...interface{}) error
- func NotFound(err error, opts ...Option) error
- func Timeout(err error, opts ...Option) error
- func Unwrap(err error, code int32) (error, bool)
- func UnwrapBadRequest(err error) (error, bool)
- func UnwrapDBError(err error) (error, bool)
- func UnwrapForbidden(err error) (error, bool)
- func UnwrapInternalServerError(err error) (error, bool)
- func UnwrapNetworkError(err error) (error, bool)
- func UnwrapNotFound(err error) (error, bool)
- func UnwrapTimeout(err error) (error, bool)
- func Wrap(err error, code int32, opts ...Option) error
- type Error
- type Option
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func BadRequest ¶ added in v0.0.3
BadRequest returns a bad request error.
func InternalServerError ¶ added in v0.0.3
InternalServerError returns an internal server error.
func IsBadRequest ¶ added in v0.0.3
IsBadRequest if err is bad request.
func IsForbidden ¶ added in v0.0.4
IsForbidden if err is forbidden.
func IsInternalServerError ¶ added in v0.0.3
IsInternalServerError if err is an internal server.
func NetworkError ¶
NetworkError returns a network error.
func Unwrap ¶ added in v0.0.2
Unwrap returns if err is Error and its code == code, and the original error will be returned, too.
func UnwrapBadRequest ¶ added in v0.0.3
UnwrapBadRequest if err is bad request.
func UnwrapDBError ¶ added in v0.0.2
UnwrapDBError if err is db error.
func UnwrapForbidden ¶ added in v0.0.4
UnwrapForbidden if err is forbidden.
func UnwrapInternalServerError ¶ added in v0.0.3
UnwrapInternalServerError if err is an internal server.
func UnwrapNetworkError ¶ added in v0.0.2
UnwrapNetworkError if err is network error.
func UnwrapNotFound ¶ added in v0.0.2
UnwrapNotFound if err is not found.
func UnwrapTimeout ¶ added in v0.0.2
UnwrapTimeout if err is timeout.
Types ¶
Click to show internal directories.
Click to hide internal directories.