added package-level globals for each error. in case the developer does not want to set their own error message or wrap another error.
parent
b59535530a
commit
bbaaf21002
|
@ -1,5 +1,11 @@
|
|||
package errhttp
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
var ErrBadGateway error = BadGatewayWrap(errors.New("Bad Gateway"))
|
||||
|
||||
type BadGateway interface {
|
||||
ServerError
|
||||
BadGateway()
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
package errhttp
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
var ErrBadRequest = BadRequestWrap(errors.New("Bad Request"))
|
||||
|
||||
type BadRequest interface {
|
||||
ClientError
|
||||
BadRequest()
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
package errhttp
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
var ErrConflict = ConflictWrap(errors.New("Conflict"))
|
||||
|
||||
type Conflict interface {
|
||||
ClientError
|
||||
Conflict()
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
package errhttp
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
var ErrExpectationFailed error = ExpectationFailedWrap(errors.New("Expectation Failed"))
|
||||
|
||||
type ExpectationFailed interface {
|
||||
ClientError
|
||||
ExpectationFailed()
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
package errhttp
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
var ErrFailedDependency error = FailedDependencyWrap(errors.New("Failed Dependency"))
|
||||
|
||||
type FailedDependency interface {
|
||||
ClientError
|
||||
FailedDependency()
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
package errhttp
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
var ErrForbidden error = ForbiddenWrap(errors.New("Forbidden"))
|
||||
|
||||
type Forbidden interface {
|
||||
ClientError
|
||||
Forbidden()
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
package errhttp
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
var ErrGatewayTimeout error = GatewayTimeoutWrap(errors.New("Gateway Timeout"))
|
||||
|
||||
type GatewayTimeout interface {
|
||||
ServerError
|
||||
GatewayTimeout()
|
||||
|
|
6
gone.go
6
gone.go
|
@ -1,5 +1,11 @@
|
|||
package errhttp
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
var ErrGone error = GoneWrap(errors.New("Gone"))
|
||||
|
||||
type Gone interface {
|
||||
ClientError()
|
||||
Gone()
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
package errhttp
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
var ErrHTTPVersionNotSupported error = HTTPVersionNotSupportedWrap(errors.New("HTTP Version Not Supported"))
|
||||
|
||||
type HTTPVersionNotSupported interface {
|
||||
ServerError
|
||||
HTTPVersionNotSupported()
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
package errhttp
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
var ErrInsufficientStorage error = InsufficientStorageWrap(errors.New("Insufficient Storage"))
|
||||
|
||||
type InsufficientStorage interface {
|
||||
ServerError
|
||||
InsufficientStorage()
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
package errhttp
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
var ErrInternalServerError error = InternalServerErrorWrap(errors.New("Internal Server Error"))
|
||||
|
||||
type InternalServerError interface {
|
||||
ServerError
|
||||
InternalServerError()
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
package errhttp
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
var ErrLengthRequired error = LengthRequiredWrap(errors.New("Length Required"))
|
||||
|
||||
type LengthRequired interface {
|
||||
ClientError
|
||||
LengthRequired()
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
package errhttp
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
var ErrLocked error = LockedWrap(errors.New("Locked"))
|
||||
|
||||
type Locked interface {
|
||||
ClientError
|
||||
Locked()
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
package errhttp
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
var ErrLoopDetected error = LoopDetectedWrap(errors.New("Loop Detected"))
|
||||
|
||||
type LoopDetected interface {
|
||||
ServerError
|
||||
LoopDetected()
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
package errhttp
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
var ErrMethodNotAllowed error = MethodNotAllowedWrap(errors.New("Method Not Allowed"))
|
||||
|
||||
type MethodNotAllowed interface {
|
||||
ClientError
|
||||
MethodNotAllowed()
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
package errhttp
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
var ErrNetworkAuthenticationRequired error = NetworkAuthenticationRequiredWrap(errors.New("Network Authentication Required"))
|
||||
|
||||
type NetworkAuthenticationRequired interface {
|
||||
ServerError
|
||||
NetworkAuthenticationRequired()
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
package errhttp
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
var ErrNotAcceptable error = NotAcceptableWrap(errors.New("Not Acceptable"))
|
||||
|
||||
type NotAcceptable interface {
|
||||
ClientError
|
||||
NotAcceptable()
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
package errhttp
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
var ErrNotExtended error = NotExtendedWrap(errors.New("Not Extended"))
|
||||
|
||||
type NotExtended interface {
|
||||
ServerError
|
||||
NotExtended()
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
package errhttp
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
var ErrNotFound error = NotFoundWrap(errors.New("Not Found"))
|
||||
|
||||
type NotFound interface {
|
||||
ClientError
|
||||
NotFound ()
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
package errhttp
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
var ErrNotImplemented error = NotImplementedWrap(errors.New("Not Implemented"))
|
||||
|
||||
type NotImplemented interface {
|
||||
ServerError
|
||||
NotImplemented()
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
package errhttp
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
var ErrPayloadTooLarge error = PayloadTooLargeWrap(errors.New("Payload Too Large"))
|
||||
|
||||
type PayloadTooLarge interface {
|
||||
ClientError
|
||||
PayloadTooLarge()
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
package errhttp
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
var ErrPaymentRequired error = PaymentRequiredWrap(errors.New("Payment Required"))
|
||||
|
||||
type PaymentRequired interface {
|
||||
ClientError
|
||||
PaymentRequired()
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
package errhttp
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
var ErrPreconditionFailed error = PreconditionFailedWrap(errors.New("Precondition Failed"))
|
||||
|
||||
type PreconditionFailed interface {
|
||||
ClientError
|
||||
PreconditionFailed()
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
package errhttp
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
var ErrPreconditionRequired error = PreconditionRequiredWrap(errors.New("Precondition Required"))
|
||||
|
||||
type PreconditionRequired interface {
|
||||
ClientError
|
||||
PreconditionRequired()
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
package errhttp
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
var ErrProxyAuthRequired error = ProxyAuthRequiredWrap(errors.New("Proxy Auth Required"))
|
||||
|
||||
type ProxyAuthRequired interface {
|
||||
ClientError
|
||||
ProxyAuthRequired()
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
package errhttp
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
var ErrRequestedRangeNotSatisfiable error = RequestedRangeNotSatisfiableWrap(errors.New("Requested Range Not Satisfiable"))
|
||||
|
||||
type RequestedRangeNotSatisfiable interface {
|
||||
ClientError
|
||||
RequestedRangeNotSatisfiable()
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
package errhttp
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
var ErrRequestEntityTooLarge error = RequestEntityTooLargeWrap(errors.New("Request Entity Too Large"))
|
||||
|
||||
type RequestEntityTooLarge interface {
|
||||
ClientError
|
||||
RequestEntityTooLarge()
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
package errhttp
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
var ErrRequestHeaderFieldsTooLarge error = RequestHeaderFieldsTooLargeWrap(errors.New("RequestHeaderFieldsTooLarge"))
|
||||
|
||||
type RequestHeaderFieldsTooLarge interface {
|
||||
error
|
||||
Err() error
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
package errhttp
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
var ErrRequestTimeout error = RequestTimeoutWrap(errors.New("Request Timeout"))
|
||||
|
||||
type RequestTimeout interface {
|
||||
error
|
||||
Err() error
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
package errhttp
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
var ErrRequestURITooLong error = RequestURITooLongWrap(errors.New("Request URI Too Long"))
|
||||
|
||||
type RequestURITooLong interface {
|
||||
error
|
||||
Err() error
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
package errhttp
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
var ErrServiceUnavailable error = ServiceUnavailableWrap(errors.New("Service Unavailable"))
|
||||
|
||||
type ServiceUnavailable interface {
|
||||
ServerError
|
||||
ServiceUnavailable()
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
package errhttp
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
var ErrTeapot error = TeapotWrap(errors.New("I'm a teapot"))
|
||||
|
||||
type Teapot interface {
|
||||
ClientError
|
||||
Teapot()
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
package errhttp
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
var ErrTooManyRequests error = TooManyRequestsWrap(errors.New("Too Many Requests"))
|
||||
|
||||
type TooManyRequests interface {
|
||||
ClientError
|
||||
TooManyRequests()
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
package errhttp
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
var ErrUnauthorized error = UnauthorizedWrap(errors.New("Unauthorized"))
|
||||
|
||||
type Unauthorized interface {
|
||||
ClientError
|
||||
Unauthorized()
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
package errhttp
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
var ErrUnavailableForLegalReasons error = UnavailableForLegalReasonsWrap(errors.New("Unavailable For Legal Reasons"))
|
||||
|
||||
type UnavailableForLegalReasons interface {
|
||||
ClientError
|
||||
UnavailableForLegalReasons()
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
package errhttp
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
var ErrUnprocessableEntity error = UnprocessableEntityWrap(errors.New("Unprocessable Entity"))
|
||||
|
||||
type UnprocessableEntity interface {
|
||||
ClientError
|
||||
UnprocessableEntity()
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
package errhttp
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
var ErrUnsupportedMediaType error = UnsupportedMediaTypeWrap(errors.New("Unsupported Media Type"))
|
||||
|
||||
type UnsupportedMediaType interface {
|
||||
ClientError
|
||||
UnsupportedMediaType()
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
package errhttp
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
var ErrUpgradeRequired error = UpgradeRequiredWrap(errors.New("Upgrade Required"))
|
||||
|
||||
type UpgradeRequired interface {
|
||||
ClientError
|
||||
UpgradeRequired()
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
package errhttp
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
var ErrURITooLong error = URITooLongWrap(errors.New("URI Too Long"))
|
||||
|
||||
type URITooLong interface {
|
||||
ClientError
|
||||
URITooLong()
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
package errhttp
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
var ErrVariantAlsoNegotiates error = VariantAlsoNegotiatesWrap(errors.New("Variant Also Negotiates"))
|
||||
|
||||
type VariantAlsoNegotiates interface {
|
||||
ServerError
|
||||
VariantAlsoNegotiates()
|
||||
|
|
Loading…
Reference in New Issue