From 1ac7f2697e2fdbcefa4325e41ba092fdbef421fa Mon Sep 17 00:00:00 2001 From: jesopo Date: Tue, 17 Sep 2019 17:09:19 +0100 Subject: [PATCH] log which URL caused an error in request_many --- src/utils/http.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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")