From 462e1028f4ad27927e8dd439018927cb93859bb3 Mon Sep 17 00:00:00 2001 From: schneefux Date: Sun, 5 Mar 2017 16:32:27 +0100 Subject: tolerate API json error --- crawler.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crawler.py b/crawler.py index 88bc93e..7ef83d7 100644 --- a/crawler.py +++ b/crawler.py @@ -1,5 +1,6 @@ #!/usr/bin/python +import json import asyncio import logging import aiohttp @@ -46,7 +47,8 @@ class Crawler(object): except (aiohttp.errors.ContentEncodingError, aiohttp.errors.ServerDisconnectedError, aiohttp.errors.ClientResponseError, - aiohttp.errors.ClientOSError): + aiohttp.errors.ClientOSError, + json.decoder.JSONDecodeError): # API bug? logging.warning("API error, retrying") pass -- cgit v1.3.1