@@ -287,6 +287,11 @@ func Error401Unauthorized(msg string, errs ...error) StatusError {
287287 return NewError (http .StatusUnauthorized , msg , errs ... )
288288}
289289
290+ // Error402PaymentRequired returns a 402.
291+ func Error402PaymentRequired (msg string , errs ... error ) StatusError {
292+ return NewError (http .StatusPaymentRequired , msg , errs ... )
293+ }
294+
290295// Error403Forbidden returns a 403.
291296func Error403Forbidden (msg string , errs ... error ) StatusError {
292297 return NewError (http .StatusForbidden , msg , errs ... )
@@ -307,6 +312,16 @@ func Error406NotAcceptable(msg string, errs ...error) StatusError {
307312 return NewError (http .StatusNotAcceptable , msg , errs ... )
308313}
309314
315+ // Error407ProxyAuthRequired returns a 407.
316+ func Error407ProxyAuthRequired (msg string , errs ... error ) StatusError {
317+ return NewError (http .StatusProxyAuthRequired , msg , errs ... )
318+ }
319+
320+ // Error408RequestTimeout returns a 408.
321+ func Error408RequestTimeout (msg string , errs ... error ) StatusError {
322+ return NewError (http .StatusRequestTimeout , msg , errs ... )
323+ }
324+
310325// Error409Conflict returns a 409.
311326func Error409Conflict (msg string , errs ... error ) StatusError {
312327 return NewError (http .StatusConflict , msg , errs ... )
@@ -317,26 +332,96 @@ func Error410Gone(msg string, errs ...error) StatusError {
317332 return NewError (http .StatusGone , msg , errs ... )
318333}
319334
335+ // Error411LengthRequired returns a 411.
336+ func Error411LengthRequired (msg string , errs ... error ) StatusError {
337+ return NewError (http .StatusLengthRequired , msg , errs ... )
338+ }
339+
320340// Error412PreconditionFailed returns a 412.
321341func Error412PreconditionFailed (msg string , errs ... error ) StatusError {
322342 return NewError (http .StatusPreconditionFailed , msg , errs ... )
323343}
324344
345+ // Error413RequestEntityTooLarge returns a 413.
346+ func Error413RequestEntityTooLarge (msg string , errs ... error ) StatusError {
347+ return NewError (http .StatusRequestEntityTooLarge , msg , errs ... )
348+ }
349+
350+ // Error414RequestURITooLong returns a 414.
351+ func Error414RequestURITooLong (msg string , errs ... error ) StatusError {
352+ return NewError (http .StatusRequestURITooLong , msg , errs ... )
353+ }
354+
325355// Error415UnsupportedMediaType returns a 415.
326356func Error415UnsupportedMediaType (msg string , errs ... error ) StatusError {
327357 return NewError (http .StatusUnsupportedMediaType , msg , errs ... )
328358}
329359
360+ // Error416RequestedRangeNotSatisfiable returns a 416.
361+ func Error416RequestedRangeNotSatisfiable (msg string , errs ... error ) StatusError {
362+ return NewError (http .StatusRequestedRangeNotSatisfiable , msg , errs ... )
363+ }
364+
365+ // Error417ExpectationFailed returns a 417.
366+ func Error417ExpectationFailed (msg string , errs ... error ) StatusError {
367+ return NewError (http .StatusExpectationFailed , msg , errs ... )
368+ }
369+
370+ // Error418Teapot returns a 418.
371+ func Error418Teapot (msg string , errs ... error ) StatusError {
372+ return NewError (http .StatusTeapot , msg , errs ... )
373+ }
374+
375+ // Error421MisdirectedRequest returns a 421.
376+ func Error421MisdirectedRequest (msg string , errs ... error ) StatusError {
377+ return NewError (http .StatusMisdirectedRequest , msg , errs ... )
378+ }
379+
330380// Error422UnprocessableEntity returns a 422.
331381func Error422UnprocessableEntity (msg string , errs ... error ) StatusError {
332382 return NewError (http .StatusUnprocessableEntity , msg , errs ... )
333383}
334384
385+ // Error423Locked returns a 423.
386+ func Error423Locked (msg string , errs ... error ) StatusError {
387+ return NewError (http .StatusLocked , msg , errs ... )
388+ }
389+
390+ // Error424FailedDependency returns a 424.
391+ func Error424FailedDependency (msg string , errs ... error ) StatusError {
392+ return NewError (http .StatusFailedDependency , msg , errs ... )
393+ }
394+
395+ // Error425TooEarly returns a 425.
396+ func Error425TooEarly (msg string , errs ... error ) StatusError {
397+ return NewError (http .StatusTooEarly , msg , errs ... )
398+ }
399+
400+ // Error426UpgradeRequired returns a 426.
401+ func Error426UpgradeRequired (msg string , errs ... error ) StatusError {
402+ return NewError (http .StatusUpgradeRequired , msg , errs ... )
403+ }
404+
405+ // Error428PreconditionRequired returns a 428.
406+ func Error428PreconditionRequired (msg string , errs ... error ) StatusError {
407+ return NewError (http .StatusPreconditionRequired , msg , errs ... )
408+ }
409+
335410// Error429TooManyRequests returns a 429.
336411func Error429TooManyRequests (msg string , errs ... error ) StatusError {
337412 return NewError (http .StatusTooManyRequests , msg , errs ... )
338413}
339414
415+ // Error431RequestHeaderFieldsTooLarge returns a 431.
416+ func Error431RequestHeaderFieldsTooLarge (msg string , errs ... error ) StatusError {
417+ return NewError (http .StatusRequestHeaderFieldsTooLarge , msg , errs ... )
418+ }
419+
420+ // Error451UnavailableForLegalReasons returns a 451.
421+ func Error451UnavailableForLegalReasons (msg string , errs ... error ) StatusError {
422+ return NewError (http .StatusUnavailableForLegalReasons , msg , errs ... )
423+ }
424+
340425// Error500InternalServerError returns a 500.
341426func Error500InternalServerError (msg string , errs ... error ) StatusError {
342427 return NewError (http .StatusInternalServerError , msg , errs ... )
@@ -362,5 +447,35 @@ func Error504GatewayTimeout(msg string, errs ...error) StatusError {
362447 return NewError (http .StatusGatewayTimeout , msg , errs ... )
363448}
364449
450+ // Error505HTTPVersionNotSupported returns a 505.
451+ func Error505HTTPVersionNotSupported (msg string , errs ... error ) StatusError {
452+ return NewError (http .StatusHTTPVersionNotSupported , msg , errs ... )
453+ }
454+
455+ // Error506VariantAlsoNegotiates returns a 506.
456+ func Error506VariantAlsoNegotiates (msg string , errs ... error ) StatusError {
457+ return NewError (http .StatusVariantAlsoNegotiates , msg , errs ... )
458+ }
459+
460+ // Error507InsufficientStorage returns a 507.
461+ func Error507InsufficientStorage (msg string , errs ... error ) StatusError {
462+ return NewError (http .StatusInsufficientStorage , msg , errs ... )
463+ }
464+
465+ // Error508LoopDetected returns a 508.
466+ func Error508LoopDetected (msg string , errs ... error ) StatusError {
467+ return NewError (http .StatusLoopDetected , msg , errs ... )
468+ }
469+
470+ // Error510NotExtended returns a 510.
471+ func Error510NotExtended (msg string , errs ... error ) StatusError {
472+ return NewError (http .StatusNotExtended , msg , errs ... )
473+ }
474+
475+ // Error511NetworkAuthenticationRequired returns a 511.
476+ func Error511NetworkAuthenticationRequired (msg string , errs ... error ) StatusError {
477+ return NewError (http .StatusNetworkAuthenticationRequired , msg , errs ... )
478+ }
479+
365480// ErrorFormatter is a function that formats an error message
366481var ErrorFormatter = fmt .Sprintf
0 commit comments