It doesn't make sense to throw web.exc.Exception from notifier level

Bug #1256220 reported by Feilong Wang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Triaged
Wishlist
Feilong Wang

Bug Description

Based on current code, there are lots of web.exc.Exception thrown from notifier level, see https://github.com/openstack/glance/blob/master/glance/notifier/__init__.py which introduced by patch https://github.com/openstack/glance/commit/437a283f24e9791f113665036e090967b8747bd2

But I think it would make more sense to throw this kind of exceptions from the API level. Given we're trying to catch the internal Glance exception instead of web.exc.Exception, see https://github.com/openstack/glance/blob/master/glance/api/v2/image_data.py#L97

Feilong Wang (flwang)
Changed in glance:
assignee: nobody → Fei Long Wang (flwang)
Revision history for this message
Flavio Percoco (flaper87) wrote :

Agreed!

It may make some sense to throw those exceptions from within the Proxies in the domain level, this can be argued, though. What seems a bit weirder to me is having proxies defined within the notifier module. I think this is a good time to refactor the code a bit and move the proxies and domain levels under the same package. IMHO, they should be under a version package as well, since they may change between different api versions.

Changed in glance:
status: New → Triaged
importance: Undecided → Wishlist
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.