-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Confirm this is an issue with the Python library and not an underlying OpenAI API
- This is an issue with the Python library
Describe the bug
In some circumstances of faulty network (like on developer laptop, poor VPN, …), httpx
raises a NetworkError
(ConnectError
, ReadError
, WriteError
, CloseError
) exception. This error is related to the network management of the library, but the library do not catch it.
It would be easier to catch NetworkError
and to map it to a APIError
.
See HTTPX doc for exception handling.
To Reproduce
- Run any command involving the remote endpoint
- Close / interrupt the network connection a few seconds
- See the error
Code snippets
No response
OS
macOS 14.3.1
Python version
Python v3.12.1
Library version
openai v1.14.0
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working