Documentation
¶
Overview ¶
Package httperr provides HTTP-centric extensions to standard errors.
Index ¶
- func Bury(status int, err error, msg string) error
- func Buryf(status int, err error, format string, args ...interface{}) error
- func Errorf(status int, format string, args ...interface{}) error
- func New(status int, msg string) error
- func StatusCode(err error) int
- func WithStack(status int, err error) error
- func WithStatus(status int, err error) error
- func Wrap(status int, err error, msg string) error
- func Wrapf(status int, err error, format string, args ...interface{}) error
- type Standard
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bury ¶
Bury buries err, exposing only msg to the end user. err is still accessible through Cause()
func StatusCode ¶
StatusCode attempts to extract the HTTP status code from err, falling back to http.StatusInternalServerError if none is found.
func WithStatus ¶
WithStatus attaches a status code to an existing error.
Types ¶
Click to show internal directories.
Click to hide internal directories.