deb-cinder/cinder/api/v1
Gorka Eguileor c491c3ee61 Handle API NotFound exceptions at WSGI level
Throughout the API code we keep catching NotFound exceptions in their
various forms and converting them to webob.exc.HTTPNotFound exceptions,
but we can leave the WSGI fault handler convert them on its own.

This patch changes current behavior and removes the exception handling
closer to the operation so that those exceptions can be handled at the
WSGI level.

This has the following benefits:

- Reduces code complexity
- Increases code readability
- Provides consistent error responses, as messages are stored on the
  Exceptions.
- Prevents raising errors with only partial information (we have cases
  now that were removing the UUID from the message because they used a
  custom message).  For example: before returned error would be "The
  resource could not be found", and now we raise "Volume type encryption
  for type 4e9e6d23-eed0-426d-b90a-28f87a94b6fe does not exist."
  automatically.
- Reduces workload for the translation team because we remove all
  unnecessary custom messages.

Change-Id: I09f98921fdc2400cc3f6056e59001100abe06920
2016-07-22 21:06:13 +02:00
..
__init__.py Moving api v1 implementation into v1 directory 2012-11-21 21:26:40 -08:00
limits.py Remove XML API 2016-04-21 16:05:29 +00:00
router.py Remove unused logging import and LOG global var 2016-05-20 17:17:38 +08:00
snapshot_metadata.py Handle API NotFound exceptions at WSGI level 2016-07-22 21:06:13 +02:00
snapshots.py Handle API NotFound exceptions at WSGI level 2016-07-22 21:06:13 +02:00
types.py Handle API NotFound exceptions at WSGI level 2016-07-22 21:06:13 +02:00
volume_metadata.py Handle API NotFound exceptions at WSGI level 2016-07-22 21:06:13 +02:00
volumes.py Handle API NotFound exceptions at WSGI level 2016-07-22 21:06:13 +02:00