Skip to content

Commit

Permalink
catch asyncio.TimeoutError in _interpret_async_response (#180) (#489)
Browse files Browse the repository at this point in the history
  • Loading branch information
vik-goel authored Jun 16, 2023
1 parent 7610c5a commit 041bf5a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions openai/api_requestor.py
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,8 @@ async def _interpret_async_response(
else:
try:
await result.read()
except (aiohttp.ServerTimeoutError, asyncio.TimeoutError) as e:
raise error.Timeout("Request timed out") from e
except aiohttp.ClientError as e:
util.log_warn(e, body=result.content)
return (
Expand Down

0 comments on commit 041bf5a

Please sign in to comment.