Documentation
¶
Index ¶
- Variables
- func Code(err error) int
- func ErrorCode(err error) int
- func ErrorName(err error) (name string, description string)
- func Join(errs ...error) error
- func JoinNew(err error, format string, a ...interface{}) error
- func New(format string, a ...interface{}) error
- func NewCode(code int, format string, a ...interface{}) error
- func Rich(err error) error
- func Safe(err error) (error, error)
- func Stack(err error) []error
- func Unwrap(err error) error
- func Wrap(err error, causedBy error) error
- type CodeError
- type DataError
- type DescError
- type LinkError
- type Multi
- type NameError
- type RichError
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrBadMethod = NewCode(400, "bad request method")
ErrBadMethod is a simple "400 Bad Request Method" Error.
View Source
var ErrInternal = NewCode(500, "internal server error")
ErrInternal is a simple "500 Internal Server Error".
View Source
var ErrNotFound = NewCode(404, "not found")
ErrNotFound is a simple "404 Not Found" Error.
ErrUnauthorized is a simple "401 Unauthorized" Error.
Functions ¶
Types ¶
type RichError ¶
type RichError struct { Name string `json:"name"` Code int `json:"code,omitempty"` Desc string `json:"desc,omitempty"` Link string `json:"link,omitempty"` Data interface{} `json:"data,omitempty"` CausedBy error `json:"causedBy,omitempty"` }
func (RichError) ErrorDescription ¶
Click to show internal directories.
Click to hide internal directories.