Merge "Give better error to client on server 500 error"
This commit is contained in:
commit
4d5db36558
@ -109,7 +109,10 @@ def Resource(controller, faults=None, deserializers=None, serializers=None):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
# NOTE(jkoelker) Everyting else is 500
|
# NOTE(jkoelker) Everyting else is 500
|
||||||
LOG.exception('%s failed' % action)
|
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}
|
kwargs = {'body': body, 'content_type': content_type}
|
||||||
raise webob.exc.HTTPInternalServerError(**kwargs)
|
raise webob.exc.HTTPInternalServerError(**kwargs)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user