Make json error message more specific

This commit is contained in:
Sasha Laundy
2013-04-08 13:03:13 -04:00
parent dfa59c2d97
commit 8ebeb3dc3f
+2 -1
View File
@@ -131,7 +131,8 @@ There's also a builtin JSON decoder, in case you're dealing with JSON data::
>>> r.json()
[{u'repository': {u'open_issues': 0, u'url': 'https://github.com/...
In case the JSON decoding fails, ``r.json`` raises an exception: ``ValueError:
In case the JSON decoding fails, ``r.json`` raises an exception. For example, if
the response gets a 401 (Unauthorized), attempting ``r.json`` raises ``ValueError:
No JSON object could be decoded``