From d8e3a1c7ee55d6d5d5ffd07363b1d0efaf07adb8 Mon Sep 17 00:00:00 2001 From: jesopo Date: Thu, 19 Sep 2019 14:02:48 +0100 Subject: [PATCH] utils.http.request_() has no self, let alone self.log --- src/utils/http.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/utils/http.py b/src/utils/http.py index eed1c0fb..4b923bda 100644 --- a/src/utils/http.py +++ b/src/utils/http.py @@ -216,6 +216,8 @@ def _request(request_obj: Request) -> Response: else: return response +class RequestManyException(Exception): + pass def request_many(urls: typing.List[str]) -> typing.Dict[str, Response]: responses = {} @@ -227,9 +229,8 @@ def request_many(urls: typing.List[str]) -> typing.Dict[str, Response]: try: response = await client.fetch(request) except: - self.log.critical("request_many failed for %s", [url], - exc_info=True) - return None + raise RequestManyException( + "request_many failed for %s", [url]) headers = utils.CaseInsensitiveDict(dict(response.headers)) data = response.body.decode("utf8")