The heat.api.middleware.fault Module

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.

error_map = {'StackValidationFailed': <class 'webob.exc.HTTPBadRequest'>, 'UserParameterMissing': <class 'webob.exc.HTTPBadRequest'>, 'UnknownUserParameter': <class 'webob.exc.HTTPBadRequest'>, 'IncompatibleObjectVersion': <class 'webob.exc.HTTPBadRequest'>, 'RevertFailed': <class 'webob.exc.HTTPInternalServerError'>, 'InvalidTemplateReference': <class 'webob.exc.HTTPBadRequest'>, 'StopActionFailed': <class 'webob.exc.HTTPInternalServerError'>, 'AttributeError': <class 'webob.exc.HTTPBadRequest'>, 'Invalid': <class 'webob.exc.HTTPBadRequest'>, 'StackExists': <class 'webob.exc.HTTPConflict'>, 'ObjectActionError': <class 'webob.exc.HTTPBadRequest'>, 'ResourceTypeUnavailable': <class 'webob.exc.HTTPBadRequest'>, 'PhysicalResourceIDAmbiguity': <class 'webob.exc.HTTPBadRequest'>, 'NotSupported': <class 'webob.exc.HTTPBadRequest'>, 'InvalidTenant': <class 'webob.exc.HTTPForbidden'>, 'ResourceNotAvailable': <class 'webob.exc.HTTPNotFound'>, 'MissingCredentialError': <class 'webob.exc.HTTPBadRequest'>, 'Forbidden': <class 'webob.exc.HTTPForbidden'>, 'UnsupportedObjectError': <class 'webob.exc.HTTPBadRequest'>, 'InvalidTemplateVersion': <class 'webob.exc.HTTPBadRequest'>, 'ActionInProgress': <class 'webob.exc.HTTPConflict'>, 'ValueError': <class 'webob.exc.HTTPBadRequest'>, 'PhysicalResourceNameAmbiguity': <class 'webob.exc.HTTPBadRequest'>, 'ServerBuildFailed': <class 'webob.exc.HTTPInternalServerError'>, 'InvalidBreakPointHook': <class 'webob.exc.HTTPBadRequest'>, 'NotFound': <class 'webob.exc.HTTPNotFound'>, 'PropertyUnspecifiedError': <class 'webob.exc.HTTPBadRequest'>, 'ResourcePropertyConflict': <class 'webob.exc.HTTPBadRequest'>, 'EventSendFailed': <class 'webob.exc.HTTPInternalServerError'>, 'ImmutableParameterModified': <class 'webob.exc.HTTPBadRequest'>, 'OrphanedObjectError': <class 'webob.exc.HTTPBadRequest'>, 'RequestLimitExceeded': <class 'webob.exc.HTTPBadRequest'>, 'InvalidGlobalResource': <class 'webob.exc.HTTPInternalServerError'>, 'EntityNotFound': <class 'webob.exc.HTTPNotFound'>, 'ObjectFieldInvalid': <class 'webob.exc.HTTPBadRequest'>, 'InvalidTemplateSection': <class 'webob.exc.HTTPBadRequest'>, 'InvalidSchemaError': <class 'webob.exc.HTTPBadRequest'>, 'ResourceActionNotSupported': <class 'webob.exc.HTTPBadRequest'>, 'ReadOnlyFieldError': <class 'webob.exc.HTTPBadRequest'>}
process_request(req)[source]
Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.