log which URL caused an error in request_many

This commit is contained in:
jesopo 2019-09-17 17:09:19 +01:00
parent ebe772a5a9
commit 1ac7f2697e

View file

@ -223,7 +223,12 @@ def request_many(urls: typing.List[str]) -> typing.Dict[str, Response]:
request = tornado.httpclient.HTTPRequest(url, method="GET", request = tornado.httpclient.HTTPRequest(url, method="GET",
connect_timeout=2, request_timeout=2) 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)) headers = utils.CaseInsensitiveDict(dict(response.headers))
data = response.body.decode("utf8") data = response.body.decode("utf8")