From 46acfd0b82b4786c5369c30edd0de922f58ebc93 Mon Sep 17 00:00:00 2001 From: howie6879 Date: Sun, 3 Jan 2021 20:59:08 +0800 Subject: [PATCH] Fixed: reqtest test error --- ruia/request.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ruia/request.py b/ruia/request.py index f72fa91..fc5bcf0 100644 --- a/ruia/request.py +++ b/ruia/request.py @@ -147,8 +147,12 @@ async def fetch_callback( :param sem: Semaphore :return: Tuple[AsyncGeneratorType, Response] """ - async with sem: - response = await self.fetch() + try: + async with sem: + response = await self.fetch() + except Exception as e: + response = None + self.logger.error(f"") if self.callback is not None: if iscoroutinefunction(self.callback):