httperror

package
v4.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 25, 2021 License: MIT Imports: 4 Imported by: 14

Documentation

Index

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

func ErrorStatus(err error) (status int, message string)

ErrorStatus guess HTTP status and message from given error

func Forbidden

func Forbidden(w http.ResponseWriter)

Forbidden sets Forbidden 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 NotFound

func NotFound(w http.ResponseWriter)

NotFound sets NotFound status

func Unauthorized

func Unauthorized(w http.ResponseWriter, err error)

Unauthorized logs error and sets Unauthorized status

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL