From 0439a669f8cbd692242b43987ee799c576f83b28 Mon Sep 17 00:00:00 2001 From: Jens Troeger Date: Mon, 7 Feb 2022 07:59:57 +1000 Subject: Adding HTTP client error 418. --- src/pyramid/httpexceptions.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src') diff --git a/src/pyramid/httpexceptions.py b/src/pyramid/httpexceptions.py index 85c2443f5..4e2b0ee1b 100644 --- a/src/pyramid/httpexceptions.py +++ b/src/pyramid/httpexceptions.py @@ -50,6 +50,7 @@ Exception * 415 - HTTPUnsupportedMediaType * 416 - HTTPRequestRangeNotSatisfiable * 417 - HTTPExpectationFailed + * 418 - HTTPImATeapot * 422 - HTTPUnprocessableEntity * 423 - HTTPLocked * 424 - HTTPFailedDependency @@ -1045,6 +1046,24 @@ class HTTPExpectationFailed(HTTPClientError): explanation = 'Expectation failed.' +class HTTPImATeapot(HTTPClientError): + """ + subclass of :class:`~HTTPClientError` + + This indicates that the server refuses to brew coffee because + it is, in fact and permanently, a teapot. The resulting entity + body may be short and stout. + + See RFC2324 and RFC7168 for more information. + + code: 418, title: I'm a teapot + """ + + code = 418 + title = "I'm a teapot" + explanation = "Refusing to brew coffee because I'm a teapot." + + class HTTPUnprocessableEntity(HTTPClientError): """ subclass of :class:`~HTTPClientError` -- cgit v1.2.3