client shouldn't return http errors directly

Bug #1431514 reported by Steve Heyman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-barbicanclient
Fix Released
Medium
John Vrbanac

Bug Description

Today we return http errors for some problems encountered by the client. This isn't terribly friendly and breaks encapsulation by exposing the underlying logic for handling requests.

It also makes it difficult to write code to leverage our client as you need to be aware of both ValueErrors and http errors for the same API call (a good example is passing an invalid secret ref - pass in a nonsense string and you get ValueError, but pass an invalid yet well formed UUID and you get http error).

We should be consistent in how we return errors, so this bug suggests that we catch those http errors and instead return them as value errors with the appropriate error messages.

Changed in python-barbicanclient:
status: New → Confirmed
Changed in python-barbicanclient:
milestone: none → 3.1.0
Changed in python-barbicanclient:
status: Confirmed → In Progress
assignee: nobody → John Vrbanac (john.vrbanac)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-barbicanclient (master)

Reviewed: https://review.openstack.org/171839
Committed: https://git.openstack.org/cgit/openstack/python-barbicanclient/commit/?id=e06df05a69755f2231bc6fb1811a5bcfacd1b6ed
Submitter: Jenkins
Branch: master

commit e06df05a69755f2231bc6fb1811a5bcfacd1b6ed
Author: John Vrbanac <email address hidden>
Date: Wed Apr 8 17:17:32 2015 -0500

    Raising errors from the client instead of ksclient

    Consolidates HTTPError types into barbicanclient.exceptions.
    Provides a uniform way of external consumers to catch
    common exceptions that might occur as a result of normal
    client operation.

    Fixes bug 1431514

    Change-Id: Id65e7da913bb06e2f94a50f44550199dc7f1beb6

Changed in python-barbicanclient:
status: In Progress → Fix Committed
Changed in python-barbicanclient:
status: Fix Committed → Fix Released
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.