summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJens Troeger <jens.troeger@light-speed.de>2022-02-07 07:59:57 +1000
committerJens Troeger <jens.troeger@light-speed.de>2022-02-07 07:59:57 +1000
commit0439a669f8cbd692242b43987ee799c576f83b28 (patch)
tree789bcd54c284bf40cd098de3f1d7428c1964f0b4 /src
parent6e152d35a0aae7f338be166e5aedbcefefe28e82 (diff)
downloadpyramid-0439a669f8cbd692242b43987ee799c576f83b28.tar.gz
pyramid-0439a669f8cbd692242b43987ee799c576f83b28.tar.bz2
pyramid-0439a669f8cbd692242b43987ee799c576f83b28.zip
Adding HTTP client error 418.
Diffstat (limited to 'src')
-rw-r--r--src/pyramid/httpexceptions.py19
1 files changed, 19 insertions, 0 deletions
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`