From 759b46259c29de812e9db9cc45238fe646b1d42b Mon Sep 17 00:00:00 2001 From: Steve Baker Date: Fri, 31 Jan 2014 16:40:54 +1300 Subject: [PATCH] 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 --- heat/api/middleware/fault.py | 1 + 1 file changed, 1 insertion(+) diff --git a/heat/api/middleware/fault.py b/heat/api/middleware/fault.py index ff926af349..645f165e30 100644 --- a/heat/api/middleware/fault.py +++ b/heat/api/middleware/fault.py @@ -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,