You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@libcloud.apache.org by Greg Hill <gr...@RACKSPACE.COM> on 2015/01/05 16:01:51 UTC
[dev] generic Exceptions on any non-200/201 response?
It appears that libcloud throws an 'Exception' with any response other than 200/201:
https://github.com/apache/libcloud/blob/trunk/libcloud/common/base.py#L116
https://github.com/apache/libcloud/blob/trunk/libcloud/common/base.py#L153
This behavior is apparently not well understand by the driver authors, though, for example:
https://github.com/apache/libcloud/blob/trunk/libcloud/compute/drivers/openstack.py#L269
And has led to a lot of confusion on my part why I'm getting "Exception: 404 Not Found" when I try to get an instance on the Rackspace cloud instead of the expected None response.
So, a couple things:
1. Why aren't we making an exception subclass that gives useful information like response code?
2. Why are we throwing exceptions for other 200-range codes (202 and 204 are both very common in REST APIs, and neither is an error)?
If I were to submit a pull-request cleaning this up, would it likely be accepted? Don't want to spend the effort if people are opposed to the idea.
Greg