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 HTTPStatus(err error) int
- func New(status int, msg string) error
- func StatusCode(err error) intdeprecated
- 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 HTTPStatus ¶ added in v0.14.0
HTTPStatus attempts to extract the HTTP status code from err, falling back to http.StatusInternalServerError if none is found.
func StatusCode
deprecated
func WithStatus ¶
WithStatus attaches a status code to an existing error.
Types ¶
type Standard ¶
type Standard int
Standard converts a standard HTTP status code into a useable error
func (Standard) HTTPStatus ¶ added in v0.14.0
HTTPStatus returns e.
Click to show internal directories.
Click to hide internal directories.