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 IsNotFound(err error) bool
- func IsPageTokenInvalid(err error) bool
- func IsRequestTimeout(err error) bool
- func Msg(err error) (string, bool)
- func MsgOrDefault(err error, defaultMsg string) string
- func New(text string) error
- func Newf(text string, params ...interface{}) error
- func NotFound(err error, opts ...Option) error
- func PageTokenInvalid(err error, opts ...Option) error
- func RequestTimeout(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 UnwrapNotFound(err error) (error, bool)
- func UnwrapPageTokenInvalid(err error) (error, bool)
- func UnwrapRequestTimeout(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 IsPageTokenInvalid ¶ added in v0.5.0
IsPageTokenInvalid if err is page token invalid.
func IsRequestTimeout ¶ added in v0.5.0
IsRequestTimeout if err is request timeout.
func MsgOrDefault ¶ added in v0.4.0
MsgOrDefault returns the msg of err or defaultMsg if err doesn't have a msg.
func PageTokenInvalid ¶ added in v0.5.0
PageTokenInvalid returns a page token invalid error.
func RequestTimeout ¶ added in v0.5.0
RequestTimeout returns a request timeout 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 UnwrapNotFound ¶ added in v0.0.2
UnwrapNotFound if err is not found.
func UnwrapPageTokenInvalid ¶ added in v0.5.0
UnwrapPageTokenInvalid if err is page token invalid.
func UnwrapRequestTimeout ¶ added in v0.5.0
UnwrapRequestTimeout if err is request timeout.