Skip to content

Commit

Permalink
Handle the case response is not json
Browse files Browse the repository at this point in the history
  • Loading branch information
Xuefeng-Zhu committed Jun 22, 2015
1 parent 5227751 commit cd0cc4e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion clf/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ def _get(self, url):
except requests.exceptions.ConnectionError:
raise RequestsException("The connection is not available")

return r.json()
try:
return r.json()
except ValueError:
return []

def _cmd_generator(self, commands):
for command in commands:
Expand Down

0 comments on commit cd0cc4e

Please sign in to comment.