Stream handling does not recognize stream errors
Problem
Confirm this is a Node library issue and not an underlying OpenAI API issue - [X] This is an issue with the Node library Describe the bug For example, when a chat completion is created like: [code block] And the underlying stream generates an error, this library will not surface the error to the application. Instead, it generates an uncaught exception error. To Reproduce See https://github.com/jsumners-nr/openai-stream-issue/tree/91e2b46b08baec3cd061a02b9492b501a353aab3 Code snippets [code block] OS macOS Node version 18.18.2 Library version 4.20.0
Error Output
error to the application. Instead, it generates an uncaught exception error.
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: Stream handling does not recognize stream errors
For what it's worth, throwing from a stream should be catchable: [code block]
Trust Score
2 verifications
- 1
For what it's worth, throwing from a stream should be catchable:
For what it's worth, throwing from a stream should be catchable:
Validation
Resolved in openai/openai-node GitHub issue #537. Community reactions: 1 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep