summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBert JW Regeer <xistence@0x58.com>2022-02-06 22:45:49 -0700
committerGitHub <noreply@github.com>2022-02-06 22:45:49 -0700
commitaf5902e4e16453cd96084d917528c6ec9b799750 (patch)
tree789bcd54c284bf40cd098de3f1d7428c1964f0b4
parent6e152d35a0aae7f338be166e5aedbcefefe28e82 (diff)
parent0439a669f8cbd692242b43987ee799c576f83b28 (diff)
downloadpyramid-af5902e4e16453cd96084d917528c6ec9b799750.tar.gz
pyramid-af5902e4e16453cd96084d917528c6ec9b799750.tar.bz2
pyramid-af5902e4e16453cd96084d917528c6ec9b799750.zip
Merge pull request #3667 from jenstroeger/master
Adding HTTP client error 418.
-rw-r--r--CONTRIBUTORS.txt2
-rw-r--r--src/pyramid/httpexceptions.py19
2 files changed, 21 insertions, 0 deletions
diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt
index 96fb6fd76..edce6e9c7 100644
--- a/CONTRIBUTORS.txt
+++ b/CONTRIBUTORS.txt
@@ -355,4 +355,6 @@ Contributors
- Thibault Ravera, 2020/06/03
+- Jens Troeger, 2021/04/08
+
- Karthikeyan Singaravelan, 2021/08/24
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`