projects
/
hamn.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b9d92fb
)
Add more info when JSON return is not in JSON format
author
Magnus Hagander
<magnus@hagander.net>
Thu, 13 Jun 2013 11:51:04 +0000
(13:51 +0200)
committer
Magnus Hagander
<magnus@hagander.net>
Thu, 13 Jun 2013 11:51:04 +0000
(13:51 +0200)
twitterclient.py
patch
|
blob
|
blame
|
history
diff --git
a/twitterclient.py
b/twitterclient.py
index 01a7d3340b730bbd23c64034e510ac2c7e325802..0a54ec53b24cb6238ec4749233d245423ba2d5ce 100644
(file)
--- a/
twitterclient.py
+++ b/
twitterclient.py
@@
-55,7
+55,12
@@
class TwitterClient(object):
# Make the actual call to twitter
ret=instream.read()
instream.close()
- return json.loads(ret)
+ try:
+ return json.loads(ret)
+ except json.decoder.JSONDecodeError:
+ print "Received non-JSON response to a JSON request!"
+ print ret
+ raise
def list_subscribers(self):
# Eek. It seems subscribers are paged even if we don't ask for it