summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCris Ewing <cris@crisewing.com>2018-05-14 17:07:00 -0400
committerCris Ewing <cris@crisewing.com>2018-05-14 17:07:00 -0400
commit391275df4eabfb2be0c8cac5de70e3a5fad5acfd (patch)
treedd4cf7d4ede8d2a0e0864cb59e0ae6731578c01c
parentba41c5675c64eb2e33100524eaa1c4073d8a007c (diff)
downloadpyramid-391275df4eabfb2be0c8cac5de70e3a5fad5acfd.tar.gz
pyramid-391275df4eabfb2be0c8cac5de70e3a5fad5acfd.tar.bz2
pyramid-391275df4eabfb2be0c8cac5de70e3a5fad5acfd.zip
Move base server and client error codes and titles to the base classes. Add a docstring to the HTTPInternalServerError
-rw-r--r--pyramid/httpexceptions.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/pyramid/httpexceptions.py b/pyramid/httpexceptions.py
index 1f3934fdc..4702a6e8e 100644
--- a/pyramid/httpexceptions.py
+++ b/pyramid/httpexceptions.py
@@ -606,7 +606,8 @@ class HTTPClientError(HTTPError):
a bug. A server-side traceback is not warranted. Unless specialized,
this is a '400 Bad Request'
"""
- pass
+ code = 400
+ title = 'Bad Request'
class HTTPBadRequest(HTTPClientError):
"""
@@ -617,8 +618,6 @@ class HTTPBadRequest(HTTPClientError):
code: 400, title: Bad Request
"""
- code = 400
- title = 'Bad Request'
explanation = ('The server could not comply with the request since '
'it is either malformed or otherwise incorrect.')
@@ -1032,11 +1031,18 @@ class HTTPServerError(HTTPError):
This is an error condition in which the server is presumed to be
in-error. Unless specialized, this is a '500 Internal Server Error'.
"""
- pass
-
-class HTTPInternalServerError(HTTPServerError):
code = 500
title = 'Internal Server Error'
+
+class HTTPInternalServerError(HTTPServerError):
+ """
+ subclass of :class:`~HTTPServerError`
+
+ This indicates that the server encountered an unexpected condition
+ which prevented it from fulfilling the request.
+
+ code: 500, title: Internal Server Error
+ """
explanation = (
'The server has either erred or is incapable of performing '
'the requested operation.')