Skip to content

Commit

Permalink
Fixed: reqtest test error
Browse files Browse the repository at this point in the history
  • Loading branch information
howie6879 committed Jan 3, 2021
1 parent 265fcbc commit 46acfd0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ruia/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"<Error: {self.url} {e}>")

if self.callback is not None:
if iscoroutinefunction(self.callback):
Expand Down

0 comments on commit 46acfd0

Please sign in to comment.