diff options
| author | 2019-09-19 14:02:48 +0100 | |
|---|---|---|
| committer | 2019-09-19 14:02:48 +0100 | |
| commit | d8e3a1c7ee55d6d5d5ffd07363b1d0efaf07adb8 (patch) | |
| tree | 97f3130ce86405b736d5fce8b39588f9b9fc02fe /src/utils | |
| parent | should be using pair_start/pair_end throughout `for` (diff) | |
| signature | ||
utils.http.request_() has no self, let alone self.log
Diffstat (limited to 'src/utils')
| -rw-r--r-- | src/utils/http.py | 7 |
1 files 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") |
