From 686d593926c34441d3a1d459e33a07229f586433 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Forr=C3=B3?= Date: Sat, 7 Jul 2018 14:08:05 +0200 Subject: [PATCH] Handle invalid JSON data from Instagram --- services/instagram.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/services/instagram.py b/services/instagram.py index 602bee7..8d5c07f 100644 --- a/services/instagram.py +++ b/services/instagram.py @@ -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