From b62ba469d7d99a1f1135eb9d2b21ea8f9f0a1efe Mon Sep 17 00:00:00 2001 From: jesopo Date: Mon, 8 Jul 2019 13:18:59 +0100 Subject: catch async exceptions in utils.http.request_many() --- src/utils/http.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/utils/http.py b/src/utils/http.py index 531c24fc..a8e8f05e 100644 --- a/src/utils/http.py +++ b/src/utils/http.py @@ -121,7 +121,12 @@ def request_many(urls: typing.List[str]) -> typing.Dict[str, Response]: client = tornado.httpclient.AsyncHTTPClient() request = tornado.httpclient.HTTPRequest(url, method="GET", connect_timeout=2, request_timeout=2) - response = await client.fetch(request) + + response = None + try: + response = await client.fetch(request) + except: + return headers = utils.CaseInsensitiveDict(dict(response.headers)) data = response.body.decode("utf8") -- cgit v1.3.1-10-gc9f91