Fix error message in share delete method
Currently, if share has snapshots, method delete() in share api service fails with 403 code, but without any error message and user can't understand what goes wrong. Error message was added to the HTTP exception, so client can show appropriate reason of error. Change-Id: Ida3b69d9ef6c7f150e2aa1980ddba653247b3175 Closes-Bug: #1400816
This commit is contained in:
parent
2023930fd7
commit
147fdfae50
@ -92,8 +92,8 @@ class ShareController(wsgi.Controller):
|
||||
self.share_api.delete(context, share)
|
||||
except exception.NotFound:
|
||||
raise exc.HTTPNotFound()
|
||||
except exception.InvalidShare:
|
||||
raise exc.HTTPForbidden()
|
||||
except exception.InvalidShare as e:
|
||||
raise exc.HTTPForbidden(explanation=six.text_type(e))
|
||||
|
||||
return webob.Response(status_int=202)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user