Map the NotFound exception to HTTPNotFound

Now if the DB API raises a NotFound which propagates
to the REST response, the user will receive a 404.

This seems to be a better default behaviour than a 500,
and other behaviours can be handled by catching NotFound
in service.py

This change is needed for the SoftwareDeployment resource
to do our usual ignore-404-on-handle_delete behaviour.

Change-Id: If00c4de41dc24f462af0b32b29cd6d70f314f3bf
This commit is contained in:
Steve Baker 2014-01-31 16:40:54 +13:00
parent 0b073c54fd
commit 759b46259c
1 changed files with 1 additions and 0 deletions

View File

@ -61,6 +61,7 @@ class FaultWrapper(wsgi.Middleware):
'ActionInProgress': webob.exc.HTTPConflict,
'ValueError': webob.exc.HTTPBadRequest,
'StackNotFound': webob.exc.HTTPNotFound,
'NotFound': webob.exc.HTTPNotFound,
'ResourceNotFound': webob.exc.HTTPNotFound,
'ResourceTypeNotFound': webob.exc.HTTPNotFound,
'ResourceNotAvailable': webob.exc.HTTPNotFound,