Cloned from launchpad blueprint https://blueprints.launchpad.net/cinder/+spec/cinder-api-error-msgs.
When a storage driver returns any error message, the text from driver exception (exception.msg) can be displayed on APIs response, for better usability.
When a volume attached to the Virtual Machine managed by a cloud manager is removed from storage backend and, if user performs any operation on the volume (like Detach or Resize), storage driver returns an Exception with specific message text that indicates what really went wrong(like Volume does not exist etc.). However, Cinder API layer does not return this and instead returns a very generic Internal Server Error 500.
If cinder api layer can display that error message along with 500 error code, that would help user understand what exactly happened beneath.
Sample error trace for an operation to detach a volume that is already deleted:
2014-07-21 15:00:52.499 19194 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.6/site-packages/cinder/volume/manager.py", line 869, in terminate_connection
2014-07-21 15:00:52.499 19194 TRACE oslo.messaging.rpc.dispatcher raise exception.VolumeBackendAPIException(data=err_msg)
2014-07-21 15:00:52.499 19194 TRACE oslo.messaging.rpc.dispatcher VolumeBackendAPIException: CN-1F54842 Bad or unexpected response from the storage volume backend API: CN-3807FD2 Unable to terminate volume connection: CN-1F54842 Bad or unexpected response from the storage volume backend API: CN-A3B1CA4 CLI Exception output:
While the above message displays "Unable to terminate...", the actual error returned from cinder driver is something like this: " The specified object does not exist, or the name supplied does not meet the naming rules"
Apparently, it helps to return this error message to end user so that it makes more vivid as to what really went wrong here
Specification URL (additional information):