summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoramitt0012016-10-28 11:06:33 +0530
committerBarry Warsaw2016-10-30 18:11:34 -0400
commit2545dc1e752a960f4dc0d0e48426fdfd9ef79cb6 (patch)
treec7300cd5349bb17ea188e1daba00968470f13df4 /src
parent7c0cbd970cca597a00ebe31687a36bccfb25445d (diff)
downloadmailman-2545dc1e752a960f4dc0d0e48426fdfd9ef79cb6.tar.gz
mailman-2545dc1e752a960f4dc0d0e48426fdfd9ef79cb6.tar.zst
mailman-2545dc1e752a960f4dc0d0e48426fdfd9ef79cb6.zip
Diffstat (limited to 'src')
-rw-r--r--src/mailman/rest/wsgiapp.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mailman/rest/wsgiapp.py b/src/mailman/rest/wsgiapp.py
index fe1a9fd63..f499ec60b 100644
--- a/src/mailman/rest/wsgiapp.py
+++ b/src/mailman/rest/wsgiapp.py
@@ -78,7 +78,11 @@ class AdminWebServiceWSGIRequestHandler(WSGIRequestHandler):
def send_error(self, code, message=None, explain=None):
"""See `BaseHTTPRequestHandler`."""
- err_code = "{0} {1}".format(code.value, code.name.replace('_', ' '))
+ try:
+ shortmsg, longmsg = self.responses[code]
+ except KeyError:
+ shortmsg, longmsg = '???', '???'
+ err_code = "{0} {1}".format(int(code), shortmsg)
header_dict = dict(
status="{0} {1}".format(self.request_version, err_code),
rsp_date=time.strftime("%a, %d %b %Y %H:%M:%S %Z", time.gmtime()),