aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar jesopo2019-09-17 17:09:19 +0100
committerGravatar jesopo2019-09-17 17:09:19 +0100
commit1ac7f2697e2fdbcefa4325e41ba092fdbef421fa (patch)
tree832bb1aed8e2ea7aacbd36f67771b65d7c38923c
parentbe explicit when a command has no help available (diff)
signature
log which URL caused an error in request_many
-rw-r--r--src/utils/http.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/utils/http.py b/src/utils/http.py
index 8f8b6dd8..4f508f6c 100644
--- a/src/utils/http.py
+++ b/src/utils/http.py
@@ -223,7 +223,12 @@ def request_many(urls: typing.List[str]) -> typing.Dict[str, Response]:
request = tornado.httpclient.HTTPRequest(url, method="GET",
connect_timeout=2, request_timeout=2)
- response = await client.fetch(request)
+ try:
+ response = await client.fetch(request)
+ except:
+ self.log.critical("request_many failed for %s", [url],
+ exc_info=True)
+ return None
headers = utils.CaseInsensitiveDict(dict(response.headers))
data = response.body.decode("utf8")