diff --git a/openqa_review/browser.py b/openqa_review/browser.py index b236718..4395fba 100644 --- a/openqa_review/browser.py +++ b/openqa_review/browser.py @@ -156,7 +156,12 @@ def _get(self, url, as_json=False): # pragma: no cover log.warn(msg) raise DownloadError(msg) - content = r.json() if as_json else r.content.decode("utf8") + try: + content = r.json() if as_json else r.content.decode("utf8") + except JSONDecodeError as e: + msg = 'Unable to decode JSON for {}: {} (Content was: "{}")'.format(url, str(e), r.content.decode("utf8")) + log.warn(msg) + raise DownloadError(msg) return content def json_rpc_get(self, url, method, params, cache=True):