Merge "Improve the error msg of v2 image_data.py"
This commit is contained in:
commit
6735fbb3f2
@ -56,13 +56,15 @@ class ImageDataController(object):
|
|||||||
LOG.debug("Cannot save data for image %s: %s", image_id, e)
|
LOG.debug("Cannot save data for image %s: %s", image_id, e)
|
||||||
raise webob.exc.HTTPBadRequest(explanation=unicode(e))
|
raise webob.exc.HTTPBadRequest(explanation=unicode(e))
|
||||||
except exception.Duplicate as e:
|
except exception.Duplicate as e:
|
||||||
msg = _("Unable to upload duplicate image data for image: %s")
|
msg = (_("Unable to upload duplicate image data for image: %s") %
|
||||||
LOG.debug(msg % image_id)
|
image_id)
|
||||||
|
LOG.debug(msg)
|
||||||
raise webob.exc.HTTPConflict(explanation=msg, request=req)
|
raise webob.exc.HTTPConflict(explanation=msg, request=req)
|
||||||
|
|
||||||
except exception.Forbidden as e:
|
except exception.Forbidden as e:
|
||||||
msg = _("Not allowed to upload image data for image %s")
|
msg = (_("Not allowed to upload image data for image %s") %
|
||||||
LOG.debug(msg % image_id)
|
image_id)
|
||||||
|
LOG.debug(msg)
|
||||||
raise webob.exc.HTTPForbidden(explanation=msg, request=req)
|
raise webob.exc.HTTPForbidden(explanation=msg, request=req)
|
||||||
|
|
||||||
except exception.NotFound as e:
|
except exception.NotFound as e:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user