From fde632fc5cc95d5abceb0493d2cbdcf274c11043 Mon Sep 17 00:00:00 2001 From: Dan Wendlandt Date: Sat, 8 Sep 2012 22:18:39 -0700 Subject: [PATCH] Give better error to client on server 500 error bug 1048109 Change-Id: Iaaa187a7868ee6227315b9c3354b424fe7c42508 --- quantum/api/v2/resource.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/quantum/api/v2/resource.py b/quantum/api/v2/resource.py index adf574e90..560ac52e9 100644 --- a/quantum/api/v2/resource.py +++ b/quantum/api/v2/resource.py @@ -109,7 +109,10 @@ def Resource(controller, faults=None, deserializers=None, serializers=None): except Exception as e: # NOTE(jkoelker) Everyting else is 500 LOG.exception('%s failed' % action) - body = serializer({'QuantumError': str(e)}) + # Do not expose details of 500 error to clients. + msg = _('Request Failed: internal server error while ' + 'processing your request.') + body = serializer({'QuantumError': msg}) kwargs = {'body': body, 'content_type': content_type} raise webob.exc.HTTPInternalServerError(**kwargs) -- 2.45.2