httperror

package
v3.37.3 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2021 License: MIT Imports: 4 Imported by: 3

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 added in v3.36.1

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 added in v3.36.1

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