You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The event fired when an error is encountered outside of a parse function or an abort.
However, I found that it is not fired on abort. Instead, the way to gracefully handle an abort seems to be with the finalContent method (there may be other ways, I didn't test). I found this out from looking at the tests.
To Reproduce
This test already has the minimal setup to reproduce. Simply add an assertion to expect emittedError to be present after aborting.
Code snippets
No response
OS
macOS
Node version
20.9.0
Library version
4.18.0
The text was updated successfully, but these errors were encountered:
Sorry about that. We hope to fix this when we can. In the meantime, you can listen to .on('abort') for this purpose. Does that work well for you?
Out of curiosity, is there a reason you'd like .on('error') to throw on aborts rather than listening to .on('abort') separately, or was it simply because that was what the docs told you to do?
Confirm this is a Node library issue and not an underlying OpenAI API issue
Describe the bug
From the
error
event documentation:However, I found that it is not fired on abort. Instead, the way to gracefully handle an abort seems to be with the
finalContent
method (there may be other ways, I didn't test). I found this out from looking at the tests.To Reproduce
This test already has the minimal setup to reproduce. Simply add an assertion to expect
emittedError
to be present after aborting.Code snippets
No response
OS
macOS
Node version
20.9.0
Library version
4.18.0
The text was updated successfully, but these errors were encountered: