Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Even in the face of urllib.error.HTTPError, return the json
Previously, if we caught a urllib.error.HTTPError, we would try to parse the json response. If we succeeded we would return _only_ the `message` field of that response. If we failed, we're return the text of the response. By "return" here, I actually mean "pack up into an Exception object and throw it". Now, if succeed in parsing the response as json, we extend that exception object so that it also contains the JSON that we got. That way, client code can find extra goodies in the json["data"] field.
- Loading branch information