-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Confirm this is a Node library issue and not an underlying OpenAI API issue
- This is an issue with the Node library
Describe the bug
The library always returns Connection Error
when hitting an invalid url instead of the full error from fetch (such as "ADDRINFO not found" or similar). This is happening because this line does not pass the message
parameter required in APIConnectionError
which makes message
undefined and resulting in the fallback string - "Connection error".
To Reproduce
- Setup OpenAI client with a custom fetch function returning a random error - "this fn does not make req"
- Make a request with the client
- The error is always "connection error" irrespective of what the fetch function contains.
Code snippets
OS
macos
Node version
20.19.0
Library version
openai v5.22
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working