summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2017-03-05 16:32:27 +0100
committerschneefux <schneefux+commit@schneefux.xyz>2017-03-05 16:32:27 +0100
commit462e1028f4ad27927e8dd439018927cb93859bb3 (patch)
tree815310b9f7253b0d556529ab025886a49161f1a5
parent03c3a1983eab29f84e5ba4997c7c34b93d4b78c7 (diff)
downloadapigrabber-462e1028f4ad27927e8dd439018927cb93859bb3.tar.gz
apigrabber-462e1028f4ad27927e8dd439018927cb93859bb3.zip
tolerate API json error
-rw-r--r--crawler.py4
1 files changed, 3 insertions, 1 deletions
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