mirror of
https://github.com/acgnhiki/blrec.git
synced 2025-04-25 05:00:23 +08:00
refactor: refactor RequestExceptionHandler
This commit is contained in:
parent
2f76809807
commit
7381d8a6dc
@ -5,6 +5,7 @@ import logging
|
||||
import time
|
||||
from typing import Optional, TypeVar
|
||||
|
||||
import aiohttp
|
||||
import requests
|
||||
import urllib3
|
||||
from reactivex import Observable, abc
|
||||
@ -42,6 +43,8 @@ class RequestExceptionHandler:
|
||||
logger.warning(repr(exc))
|
||||
except asyncio.exceptions.TimeoutError:
|
||||
logger.warning(repr(exc))
|
||||
except aiohttp.ClientError:
|
||||
logger.warning(repr(exc))
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
@ -65,6 +68,7 @@ class RequestExceptionHandler:
|
||||
requests.exceptions.RequestException, # XXX: ConnectionError
|
||||
urllib3.exceptions.HTTPError,
|
||||
asyncio.exceptions.TimeoutError,
|
||||
aiohttp.ClientError,
|
||||
),
|
||||
):
|
||||
return True
|
||||
|
Loading…
Reference in New Issue
Block a user