Skip to content
This repository was archived by the owner on Nov 2, 2023. It is now read-only.

Commit 377efd1

Browse files
committed
print the query when the json conversion fail
1 parent 46f629c commit 377efd1

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

wekeypedia/wikipedia/api.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ def get(self, query):
2323
result : dict
2424
"""
2525
r = requests.get(self.url, params=query)
26-
27-
result = r.json()
28-
return result
26+
27+
try:
28+
result = r.json()
29+
except ValueError:
30+
print self.url
31+
print query
32+
exit()
33+
34+
35+
return result

0 commit comments

Comments
 (0)