Confirm this is a Node library issue and not an underlying OpenAI API issue
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
Confirm this is a Node library issue and not an underlying OpenAI API issue
Describe the bug
The library always returns
Connection Errorwhen 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 themessageparameter required inAPIConnectionErrorwhich makesmessageundefined and resulting in the fallback string - "Connection error".To Reproduce
Code snippets
OS
macos
Node version
20.19.0
Library version
openai v5.22