Documentation ¶
Index ¶
- func BadRequest(w http.ResponseWriter, err error)
- func ErrorStatus(err error) (status int, message string)
- func Forbidden(w http.ResponseWriter)
- 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 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.