From 58fbca2a7605ed1306c41ab9e00d5839288e67f0 Mon Sep 17 00:00:00 2001 From: Cris Ewing <cris@crisewing.com> Date: Mon, 14 May 2018 23:29:03 +0200 Subject: [PATCH] Move base server and client error codes and titles to the base classes. Add a docstring to the HTTPInternalServerError --- pyramid/httpexceptions.py | 18 ++++++++++++------ 1 files changed, 12 insertions(+), 6 deletions(-) diff --git a/pyramid/httpexceptions.py b/pyramid/httpexceptions.py index 1f3934f..4702a6e 100644 --- a/pyramid/httpexceptions.py +++ b/pyramid/httpexceptions.py @@ -606,7 +606,8 @@ 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 @@ 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 @@ 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.') -- Gitblit v1.9.3