Permalink
Browse files

Merge pull request #1296 from sursh/master

Add helpful error message to r.json() method
  • Loading branch information...
2 parents fa9234d + 8ebeb3d commit 5b937b384b187899851d62dad1be5e2ca4686a36 @kennethreitz committed Apr 8, 2013
Showing with 3 additions and 1 deletion.
  1. +3 −1 docs/user/quickstart.rst
View
4 docs/user/quickstart.rst
@@ -131,7 +131,9 @@ 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.
+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``
Raw Response Content

0 comments on commit 5b937b3

Please sign in to comment.