@@ -291,24 +291,53 @@ var (
291
291
292
292
// Errors
293
293
var (
294
- ErrUnsupportedMediaType = NewHTTPError (http .StatusUnsupportedMediaType )
295
- ErrNotFound = NewHTTPError (http .StatusNotFound )
296
- ErrUnauthorized = NewHTTPError (http .StatusUnauthorized )
297
- ErrForbidden = NewHTTPError (http .StatusForbidden )
298
- ErrMethodNotAllowed = NewHTTPError (http .StatusMethodNotAllowed )
299
- ErrStatusRequestEntityTooLarge = NewHTTPError (http .StatusRequestEntityTooLarge )
300
- ErrTooManyRequests = NewHTTPError (http .StatusTooManyRequests )
301
- ErrBadRequest = NewHTTPError (http .StatusBadRequest )
302
- ErrBadGateway = NewHTTPError (http .StatusBadGateway )
303
- ErrInternalServerError = NewHTTPError (http .StatusInternalServerError )
304
- ErrRequestTimeout = NewHTTPError (http .StatusRequestTimeout )
305
- ErrServiceUnavailable = NewHTTPError (http .StatusServiceUnavailable )
306
- ErrValidatorNotRegistered = errors .New ("validator not registered" )
307
- ErrRendererNotRegistered = errors .New ("renderer not registered" )
308
- ErrInvalidRedirectCode = errors .New ("invalid redirect status code" )
309
- ErrCookieNotFound = errors .New ("cookie not found" )
310
- ErrInvalidCertOrKeyType = errors .New ("invalid cert or key type, must be string or []byte" )
311
- ErrInvalidListenerNetwork = errors .New ("invalid listener network" )
294
+ ErrBadRequest = NewHTTPError (http .StatusBadRequest ) // HTTP 400 Bad Request
295
+ ErrUnauthorized = NewHTTPError (http .StatusUnauthorized ) // HTTP 401 Unauthorized
296
+ ErrPaymentRequired = NewHTTPError (http .StatusPaymentRequired ) // HTTP 402 Payment Required
297
+ ErrForbidden = NewHTTPError (http .StatusForbidden ) // HTTP 403 Forbidden
298
+ ErrNotFound = NewHTTPError (http .StatusNotFound ) // HTTP 404 Not Found
299
+ ErrMethodNotAllowed = NewHTTPError (http .StatusMethodNotAllowed ) // HTTP 405 Method Not Allowed
300
+ ErrNotAcceptable = NewHTTPError (http .StatusNotAcceptable ) // HTTP 406 Not Acceptable
301
+ ErrProxyAuthRequired = NewHTTPError (http .StatusProxyAuthRequired ) // HTTP 407 Proxy AuthRequired
302
+ ErrRequestTimeout = NewHTTPError (http .StatusRequestTimeout ) // HTTP 408 Request Timeout
303
+ ErrConflict = NewHTTPError (http .StatusConflict ) // HTTP 409 Conflict
304
+ ErrGone = NewHTTPError (http .StatusGone ) // HTTP 410 Gone
305
+ ErrLengthRequired = NewHTTPError (http .StatusLengthRequired ) // HTTP 411 Length Required
306
+ ErrPreconditionFailed = NewHTTPError (http .StatusPreconditionFailed ) // HTTP 412 Precondition Failed
307
+ ErrStatusRequestEntityTooLarge = NewHTTPError (http .StatusRequestEntityTooLarge ) // HTTP 413 Payload Too Large
308
+ ErrRequestURITooLong = NewHTTPError (http .StatusRequestURITooLong ) // HTTP 414 URI Too Long
309
+ ErrUnsupportedMediaType = NewHTTPError (http .StatusUnsupportedMediaType ) // HTTP 415 Unsupported Media Type
310
+ ErrRequestedRangeNotSatisfiable = NewHTTPError (http .StatusRequestedRangeNotSatisfiable ) // HTTP 416 Range Not Satisfiable
311
+ ErrExpectationFailed = NewHTTPError (http .StatusExpectationFailed ) // HTTP 417 Expectation Failed
312
+ ErrTeapot = NewHTTPError (http .StatusTeapot ) // HTTP 418 I'm a teapot
313
+ ErrMisdirectedRequest = NewHTTPError (http .StatusMisdirectedRequest ) // HTTP 421 Misdirected Request
314
+ ErrUnprocessableEntity = NewHTTPError (http .StatusUnprocessableEntity ) // HTTP 422 Unprocessable Entity
315
+ ErrLocked = NewHTTPError (http .StatusLocked ) // HTTP 423 Locked
316
+ ErrFailedDependency = NewHTTPError (http .StatusFailedDependency ) // HTTP 424 Failed Dependency
317
+ ErrTooEarly = NewHTTPError (http .StatusTooEarly ) // HTTP 425 Too Early
318
+ ErrUpgradeRequired = NewHTTPError (http .StatusUpgradeRequired ) // HTTP 426 Upgrade Required
319
+ ErrPreconditionRequired = NewHTTPError (http .StatusPreconditionRequired ) // HTTP 428 Precondition Required
320
+ ErrTooManyRequests = NewHTTPError (http .StatusTooManyRequests ) // HTTP 429 Too Many Requests
321
+ ErrRequestHeaderFieldsTooLarge = NewHTTPError (http .StatusRequestHeaderFieldsTooLarge ) // HTTP 431 Request Header Fields Too Large
322
+ ErrUnavailableForLegalReasons = NewHTTPError (http .StatusUnavailableForLegalReasons ) // HTTP 451 Unavailable For Legal Reasons
323
+ ErrInternalServerError = NewHTTPError (http .StatusInternalServerError ) // HTTP 500 Internal Server Error
324
+ ErrNotImplemented = NewHTTPError (http .StatusNotImplemented ) // HTTP 501 Not Implemented
325
+ ErrBadGateway = NewHTTPError (http .StatusBadGateway ) // HTTP 502 Bad Gateway
326
+ ErrServiceUnavailable = NewHTTPError (http .StatusServiceUnavailable ) // HTTP 503 Service Unavailable
327
+ ErrGatewayTimeout = NewHTTPError (http .StatusGatewayTimeout ) // HTTP 504 Gateway Timeout
328
+ ErrHTTPVersionNotSupported = NewHTTPError (http .StatusHTTPVersionNotSupported ) // HTTP 505 HTTP Version Not Supported
329
+ ErrVariantAlsoNegotiates = NewHTTPError (http .StatusVariantAlsoNegotiates ) // HTTP 506 Variant Also Negotiates
330
+ ErrInsufficientStorage = NewHTTPError (http .StatusInsufficientStorage ) // HTTP 507 Insufficient Storage
331
+ ErrLoopDetected = NewHTTPError (http .StatusLoopDetected ) // HTTP 508 Loop Detected
332
+ ErrNotExtended = NewHTTPError (http .StatusNotExtended ) // HTTP 510 Not Extended
333
+ ErrNetworkAuthenticationRequired = NewHTTPError (http .StatusNetworkAuthenticationRequired ) // HTTP 511 Network Authentication Required
334
+
335
+ ErrValidatorNotRegistered = errors .New ("validator not registered" )
336
+ ErrRendererNotRegistered = errors .New ("renderer not registered" )
337
+ ErrInvalidRedirectCode = errors .New ("invalid redirect status code" )
338
+ ErrCookieNotFound = errors .New ("cookie not found" )
339
+ ErrInvalidCertOrKeyType = errors .New ("invalid cert or key type, must be string or []byte" )
340
+ ErrInvalidListenerNetwork = errors .New ("invalid listener network" )
312
341
)
313
342
314
343
// Error handlers
0 commit comments