Merge lp://staging/~jml/piston-mini-client/richer-errors into lp://staging/piston-mini-client

Proposed by Jonathan Lange
Status: Merged
Approved by: Anthony Lenton
Approved revision: 64
Merged at revision: 60
Proposed branch: lp://staging/~jml/piston-mini-client/richer-errors
Merge into: lp://staging/piston-mini-client
Diff against target: 155 lines (+66/-5)
4 files modified
piston_mini_client/__init__.py (+19/-3)
piston_mini_client/failhandlers.py (+1/-1)
piston_mini_client/tests/test_failhandlers.py (+18/-0)
piston_mini_client/tests/test_resource.py (+28/-1)
To merge this branch: bzr merge lp://staging/~jml/piston-mini-client/richer-errors
Reviewer Review Type Date Requested Status
Anthony Lenton Approve
Michael Vogt (community) Approve
Review via email: mp+115774@code.staging.launchpad.net

Commit message

Raise more informative errors when we cannot parse JSON

Description of the change

json.loads is a bit poor. If it can't parse the JSON string you give it,
it raises a ValueError telling you so. Much more useful is to raise a
ValueError with the actual thing that it couldn't parse.

This branch does that. It also incidentally fixes a typo in APIError.

To post a comment you must log in.
Revision history for this message
Michael Vogt (mvo) wrote :

Looks good to me. Maybe this would also be a good opportunity to switch to unittest2, what do you think Anthony?

review: Approve
Revision history for this message
Jonathan Lange (jml) wrote :

On 19 July 2012 18:21, Michael Vogt <email address hidden> wrote:
> Review: Approve
>
> Looks good to me. Maybe this would also be a good opportunity to switch to unittest2, what do you think Anthony?

Or testtools :P

64. By Jonathan Lange

APIError rather than ValueError.

Revision history for this message
Anthony Lenton (elachuni) wrote :

Thanks jml!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches