From 79589f2596cd481b9802408feda5a34aa4805bde Mon Sep 17 00:00:00 2001 From: Michael Hanselmann <hansmi@google.com> Date: Thu, 18 Dec 2008 13:45:41 +0000 Subject: [PATCH] Rename http.HttpInternalError to HttpInternalServerError All other exceptions are named after the error name in RFC2616 (HTTP/1.1). Reviewed-by: amishchenko --- lib/http/__init__.py | 2 +- lib/http/server.py | 4 ++-- lib/rapi/rlib1.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/http/__init__.py b/lib/http/__init__.py index dab1327f3..769e21ebc 100644 --- a/lib/http/__init__.py +++ b/lib/http/__init__.py @@ -231,7 +231,7 @@ class HttpPreconditionFailed(HttpException): code = 412 -class HttpInternalError(HttpException): +class HttpInternalServerError(HttpException): """500 Internal Server Error RFC2616, 10.5.1: The server encountered an unexpected condition which diff --git a/lib/http/server.py b/lib/http/server.py index a671591f6..0a75052db 100644 --- a/lib/http/server.py +++ b/lib/http/server.py @@ -316,10 +316,10 @@ class _HttpServerRequestExecutor(object): raise except Exception, err: logging.exception("Caught exception") - raise http.HttpInternalError(message=str(err)) + raise http.HttpInternalServerError(message=str(err)) except: logging.exception("Unknown exception") - raise http.HttpInternalError(message="Unknown error") + raise http.HttpInternalServerError(message="Unknown error") # TODO: Content-type encoder = http.HttpJsonConverter() diff --git a/lib/rapi/rlib1.py b/lib/rapi/rlib1.py index f4ef9a9c5..afc0e6a52 100644 --- a/lib/rapi/rlib1.py +++ b/lib/rapi/rlib1.py @@ -232,6 +232,6 @@ class R_os(baserlib.R_Generic): diagnose_data = ganeti.cli.SubmitOpCode(op) if not isinstance(diagnose_data, list): - raise http.HttpInternalError(message="Can't get OS list") + raise http.HttpInternalServerError(message="Can't get OS list") return [row[0] for row in diagnose_data if row[1]] -- GitLab