Skip to content

Commit 041bf5a

Browse files
authored
catch asyncio.TimeoutError in _interpret_async_response (#180) (#489)
1 parent 7610c5a commit 041bf5a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

openai/api_requestor.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -720,6 +720,8 @@ async def _interpret_async_response(
720720
else:
721721
try:
722722
await result.read()
723+
except (aiohttp.ServerTimeoutError, asyncio.TimeoutError) as e:
724+
raise error.Timeout("Request timed out") from e
723725
except aiohttp.ClientError as e:
724726
util.log_warn(e, body=result.content)
725727
return (

0 commit comments

Comments
 (0)