Documentation ¶
Index ¶
- func BadRequest(w http.ResponseWriter, err error)
- func ErrorStatus(err error) (status int, message string)
- func Forbidden(w http.ResponseWriter)
- func FromResponse(resp *http.Response, err error) error
- func FromStatus(status int, err error) error
- func HandleError(w http.ResponseWriter, err error) bool
- func InternalServerError(w http.ResponseWriter, err error)
- func NotFound(w http.ResponseWriter)
- func Unauthorized(w http.ResponseWriter, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BadRequest ¶
func BadRequest(w http.ResponseWriter, err error)
BadRequest logs error and sets BadRequest status.
func ErrorStatus ¶
ErrorStatus guess HTTP status and message from given error.
func FromResponse ¶ added in v4.46.3
FromResponse wraps model's error according to given response
func FromStatus ¶ added in v4.46.2
FromStatus wraps model's error according to status.
func HandleError ¶
func HandleError(w http.ResponseWriter, err error) bool
HandleError return a status code according to given error.
func InternalServerError ¶
func InternalServerError(w http.ResponseWriter, err error)
InternalServerError logs error and sets InternalServerError status.
func Unauthorized ¶
func Unauthorized(w http.ResponseWriter, err error)
Unauthorized logs error and sets Unauthorized status.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.