Documentation
¶
Index ¶
- Variables
- func DBError(err error) error
- func Is(err error, code int32) bool
- func IsDBError(err error) bool
- func IsNetworkError(err error) bool
- func IsNotFound(err error) bool
- func IsTimeout(err error) bool
- func NetworkError(err error) error
- func New(text string) error
- func NotFound(err error) error
- func Timeout(err error) error
- func Unwrap(err error, code int32) (error, bool)
- func UnwrapDBError(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) error
- type Error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrorFormat formats e and returns a string in Error(). ErrorFormat = func(e *Error) string { return fmt.Sprintf("%s", e.err.Error()) } // StringFormat formats e and returns a string in String(). StringFormat = func(e *Error) string { return fmt.Sprintf("%d (%s)", e.code, e.err.Error()) } )
Functions ¶
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 UnwrapDBError ¶ added in v0.0.2
UnwrapDBError if err is db error.
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.