diff options
| author | Johannes Erdfelt <johannes.erdfelt@rackspace.com> | 2011-11-07 18:05:35 +0000 |
|---|---|---|
| committer | Johannes Erdfelt <johannes.erdfelt@rackspace.com> | 2011-11-07 18:05:35 +0000 |
| commit | affb5821342b91f4371fe79e82a6a28a54d97bc7 (patch) | |
| tree | 4a3497d78a79edf4d19b7989cc4208b171ba5caa /nova/api | |
| parent | d90aaaafbc11c8e951ccde27cac11f70ae65c9b2 (diff) | |
Clean up docstrings for faults.Fault and it's usage
Many extensions wrapped exceptions manually with faults.Fault and ther
continues to be some confusion if it's necessary. This patch clears up
what faults.Fault does as well as documents that wsgi.Resource
automatically wraps webob.exc.HTTPException
Change-Id: Ieed63b8641499bc7449bae2684d5f63e5839d369
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/faults.py | 2 | ||||
| -rw-r--r-- | nova/api/openstack/wsgi.py | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/nova/api/openstack/faults.py b/nova/api/openstack/faults.py index 0ef863eed..52d64c283 100644 --- a/nova/api/openstack/faults.py +++ b/nova/api/openstack/faults.py @@ -24,7 +24,7 @@ from nova.api.openstack import wsgi class Fault(webob.exc.HTTPException): - """An RS API fault response.""" + """Wrap webob.exc.HTTPException to provide API friendly response.""" _fault_names = { 400: "badRequest", diff --git a/nova/api/openstack/wsgi.py b/nova/api/openstack/wsgi.py index a3ca5cd5b..f96a12eab 100644 --- a/nova/api/openstack/wsgi.py +++ b/nova/api/openstack/wsgi.py @@ -527,6 +527,9 @@ class Resource(wsgi.Application): They may raise a webob.exc exception or return a dict, which will be serialized by requested content type. + Exceptions derived from webob.exc.HTTPException will be automatically + wrapped in faults.Fault() to provide API friendly error responses. + """ def __init__(self, controller, deserializer=None, serializer=None): |
