]> review.fuel-infra Code Review - openstack-build/heat-build.git/commit
Ensure all REST API error responses are consistent
authorLuis A. Garcia <luis@linux.vnet.ibm.com>
Tue, 6 Aug 2013 18:36:02 +0000 (18:36 +0000)
committerLuis A. Garcia <luis@linux.vnet.ibm.com>
Thu, 8 Aug 2013 22:01:30 +0000 (22:01 +0000)
commit433da2654372cf6e1841b24266d3318c7d0c14af
tree04ac6a1acc83649e3a841173dd6bb05d6cb645a8
parent3f6b8758b707e16f7ffa4119c087d74e2b9c4fe3
Ensure all REST API error responses are consistent

Heat exceptions are serialized into JSON/XML responses by the fault app,
which is at the end of the WSGI pipeline. Some REST API errors however
are raised as HTTPExceptions, which are treated by WSGI as responses
ready to be sent back to the user, and they can't reach the fault app.

This patch set disguises HTTPExceptions raised by the wsgi.Resource so
they can reach the app that will serialize them just like all other
errors.

Fixes bug 1208620

Change-Id: Id98dbc1e3b208401be8f0119a6d72d4561a2221a
heat/api/middleware/fault.py
heat/common/exception.py
heat/common/wsgi.py
heat/tests/test_api_openstack_v1.py
heat/tests/test_wsgi.py