Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // 4xx errors ErrBadRequest = New(http.StatusBadRequest) ErrPaymentRequired = New(http.StatusPaymentRequired) ErrForbidden = New(http.StatusForbidden) ErrNotFound = New(http.StatusNotFound) ErrMethodNotAllowed = New(http.StatusMethodNotAllowed) ErrNotAcceptable = New(http.StatusNotAcceptable) ErrProxyAuthRequired = New(http.StatusProxyAuthRequired) ErrRequestTimeout = New(http.StatusRequestTimeout) ErrConflict = New(http.StatusConflict) ErrResourceGone = New(http.StatusGone) ErrLengthRequired = New(http.StatusLengthRequired) ErrPreconditionFailed = New(http.StatusPreconditionFailed) ErrEntityTooLarge = New(http.StatusRequestEntityTooLarge) ErrURITooLong = New(http.StatusRequestURITooLong) ErrUnsupportedMediaType = New(http.StatusUnsupportedMediaType) ErrRangeNotSatisfiable = New(http.StatusRequestedRangeNotSatisfiable) ErrExpectationFailed = New(http.StatusExpectationFailed) ErrMisdirectedRequest = New(http.StatusMisdirectedRequest) ErrUnprocessableEntity = New(http.StatusUnprocessableEntity) ErrLocked = New(http.StatusLocked) ErrFailedDependency = New(http.StatusFailedDependency) ErrTooEarly = New(http.StatusTooEarly) ErrPreconditionRequired = New(http.StatusPreconditionRequired) ErrTooManyRequests = New(http.StatusTooManyRequests) ErrHeaderFieldsTooLarge = New(http.StatusRequestHeaderFieldsTooLarge) ErrIllegal = New(http.StatusUnavailableForLegalReasons) // 5xx errors ErrInternalServer = New(http.StatusInternalServerError) ErrNotImplemented = New(http.StatusNotImplemented) ErrBadGateway = New(http.StatusBadGateway) ErrGatewayTimeout = New(http.StatusGatewayTimeout) ErrHTTPVersionNotSupported = New(http.StatusHTTPVersionNotSupported) ErrVariantAlsoNegotiates = New(http.StatusVariantAlsoNegotiates) ErrInsufficientStorage = New(http.StatusInsufficientStorage) ErrLoopDetected = New(http.StatusLoopDetected) ErrNotExtended = New(http.StatusNotExtended) ErrNetworkAuthenticationRequired = New(http.StatusNetworkAuthenticationRequired) )
Functions ¶
func Wrap ¶
Wrap will create a new ErrHttp and place the provided error inside of it. There is a complementary errors.Unwrap to retrieve the wrapped error.
func Write ¶
func Write(w http.ResponseWriter, err error)
Write sets the response status code to the provided error code. When unable to find an ErrHttp error in the error chain then a 500 internal error is output.
Types ¶
Click to show internal directories.
Click to hide internal directories.