Dealing with errors during body stream reading #1614
Unanswered
cyruscollier
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey everyone! The API I'm using occasionally throws one of the following errors while using Node Fetch v3.2.4:
Invalid response body while trying to fetch https://[request URL]/: Premature close
Body used already for: https://[request URL]/
Request to https://[request URL]/ failed, reason: socket hang up ()
My implementation is very basic:
The errors are infrequent, but show up enough in the production logs that I'm concerned, especially given the modest level of traffic to the site so far. The first error I've twice been able to somewhat reliably trigger it on one endpoint for a short period of time and then will go away after a period of time. The other two I haven't been able to reproduce at all. Here's what I do know:
The ideas I have so far to solve this:
Thank you in advance for any other ideas you might have!
Beta Was this translation helpful? Give feedback.
All reactions