Handle invalid JSON data from Instagram

master
Nikola Forró 6 years ago
parent d30e01ba9f
commit 686d593926

@ -86,5 +86,7 @@ class Instagram(object):
result = self._get_media()
except requests.exceptions.HTTPError as e:
raise InstagramError('Failed to retrieve media: {0}'.format(e))
except json.decoder.JSONDecodeError as e:
raise InstagramError('Failed to retrieve media: {0}'.format(e))
else:
return result

Loading…
Cancel
Save