Exception Hierarchy in Fog

51 views
Skip to first unread message

Kyle Rames

unread,
Apr 11, 2013, 10:20:44 AM4/11/13
to ruby...@googlegroups.com
I am currently making a change to the NotFound exception in the Rackspace provider and I am a little confused about Fog's exception hierarchy. 

There is a  service specific (ie Fog::Storage::Rackspace::NotFound) NotFound exception being created here:


And then it appears that provider specific (Fog::Rackspace::Errors::NotFound) NotFound exception being created for a couple providers:


I have a feeling that the second type is incorrect.

Thoughts?

Kyle

geemus (Wesley Beary)

unread,
Apr 11, 2013, 10:36:10 AM4/11/13
to ruby...@googlegroups.com
I'd say probably the service specific ones are more correct. Also, at the very least, the provider ones should inherit from Fog::Errors::NotFound also, to provide for rescuing it the same regardless of provider. I should think that a service level error should always be good enough for NotFound, but perhaps there is a case where the scope is outside a particular service and then a provider level NotFound would work (I'm unable to think of such a case at present though.



Kyle

--
You received this message because you are subscribed to the Google Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-fog+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Kyle Rames

unread,
Apr 11, 2013, 10:59:00 AM4/11/13
to ruby...@googlegroups.com
Makes sense!

I figured people had created the provider level classes because they weren't aware of the meta programmed service ones.

Kyle
Reply all
Reply to author
Forward
0 new messages