httperrors

package
v0.0.0-...-d4224cb Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BadRequest

func BadRequest(c echo.Context, message string) (e error)

BadRequest response code (400) indicates that the server could not understand the request due to invalid syntax.

func Conflict

func Conflict(c echo.Context, message string) (e error)

Conflict response code (409) indicates a request conflict with current state of the server.

func Forbidden

func Forbidden(c echo.Context, message string) (e error)

Forbidden response code (403) indicates that the server understood the request but refuses to authorize it.

func GetHTTPResponseFromErr

func GetHTTPResponseFromErr(c echo.Context, err error) (e error)

GetHTTPResponseFromErr returns the mapped http error to the generic errors model.

func Gone

func Gone(c echo.Context, message string) (e error)

Gone response code (410) indicates that access to the target resource is no longer available at the origin server and that this condition is likely to be permanent.

func HTTPError

func HTTPError(c echo.Context, statusCode int, message string) (e error)

HTTPError returns a HTTP error with a descriptive JSON body

func InternalServerError

func InternalServerError(c echo.Context, message string) (e error)

InternalServerError response code (500) indicates that the server encountered an unexpected condition that prevented it from fulfilling the request.

func MethodNotAllowed

func MethodNotAllowed(c echo.Context, message string) (e error)

MethodNotAllowed response code (405) indicates that the request method is known by the server but is not supported by the target resource.

func NotFound

func NotFound(c echo.Context, message string) (e error)

NotFound response code (404) indicates that the server can't find the requested resource

func NotImplemented

func NotImplemented(c echo.Context, message string) (e error)

NotImplemented response code (501) indicates that the server does not support the functionality required to fulfill the request.

func Unauthorized

func Unauthorized(c echo.Context, message string) (e error)

Unauthorized response code (401) indicates that the request has not been applied because it lacks valid authentication credentials for the target resource.

func UnsupportedMediaType

func UnsupportedMediaType(c echo.Context, message string) (e error)

UnsupportedMediaType response code (415) indicates that the server refuses to accept the request because the payload format is in an unsupported format.

Types

This section is empty.

Jump to

Keyboard shortcuts

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