Skip to content

Commit

Permalink
add a new except in make_request for the RequestFailed Exception to p…
Browse files Browse the repository at this point in the history
…ass the exception to calling process
  • Loading branch information
Xlitoni committed Nov 16, 2023
1 parent 840281c commit 1e1d124
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/api/rate_limiter.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,14 @@ async def handle_requests(self):

try:
self.requests[request.key]["result"] = self.handle_get_request(request)
except RLRequestFailed as exc:
# Request failed and should not be sent again
self.requests[request.key]["result"] = None
# set the exception
self.requests[request.key]["exception"] = (
RLRequestFailed(request, self.logger.error, "Request Failed"),
exc,
)
except RateLimiterError as exc:
if isinstance(exc, RLErrorWithPause):
await self.pause(exc.time_to_wait)
Expand Down

0 comments on commit 1e1d124

Please sign in to comment.