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 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Anthony Lenton | Approve | ||
Michael Vogt (community) | Approve | ||
Review via email:
|
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.
Looks good to me. Maybe this would also be a good opportunity to switch to unittest2, what do you think Anthony?