The heat.api.middleware.fault Module
A middleware that turns exceptions into parsable string. Inspired by
Cinder’s faultwrapper
-
class heat.api.middleware.fault.Fault(error)[source]
Bases: object
-
class heat.api.middleware.fault.FaultWrapper(application)[source]
Bases: heat.common.wsgi.Middleware
Replace error body with something the client can parse.
-
FaultWrapper.error_map = {'MissingCredentialError': <class 'webob.exc.HTTPBadRequest'>, 'StackValidationFailed': <class 'webob.exc.HTTPBadRequest'>, 'InvalidTenant': <class 'webob.exc.HTTPForbidden'>, 'ResourceTypeNotFound': <class 'webob.exc.HTTPNotFound'>, 'InvalidTemplateReference': <class 'webob.exc.HTTPBadRequest'>, 'RequestLimitExceeded': <class 'webob.exc.HTTPBadRequest'>, 'StackNotFound': <class 'webob.exc.HTTPNotFound'>, 'ServerBuildFailed': <class 'webob.exc.HTTPInternalServerError'>, 'UnknownUserParameter': <class 'webob.exc.HTTPBadRequest'>, 'StackExists': <class 'webob.exc.HTTPConflict'>, 'ResourceNotFound': <class 'webob.exc.HTTPNotFound'>, 'RevertFailed': <class 'webob.exc.HTTPInternalServerError'>, 'ResourceNotAvailable': <class 'webob.exc.HTTPNotFound'>, 'PhysicalResourceNotFound': <class 'webob.exc.HTTPNotFound'>, 'NotSupported': <class 'webob.exc.HTTPBadRequest'>, 'AttributeError': <class 'webob.exc.HTTPBadRequest'>, 'ValueError': <class 'webob.exc.HTTPBadRequest'>, 'UserParameterMissing': <class 'webob.exc.HTTPBadRequest'>}
-
FaultWrapper.process_request(req)[source]