Methods that perform a fetch should throw any socket errors directly (ECONNRESET) #5300
Labels
priority: p2
Moderately-important priority. Fix may not be included in next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Related: #2254
Environment details
@google-cloud/storage
Steps to reproduce
When running multiple uploads in parallel, we frequently encounter
ECONNRESET
socket errors such asThese happen for us using the
Bucket#upload
method, and we would like to be able to catch the error and handle it appropriately, but the error is thrown in such a way that it can't be caught by a try/catch on Bucket#upload an instead needs to be captured at the process level by an event handler.When GCS is instantiating the node-fetch client, the client should capture any FetchError and reject the promise with it.
The text was updated successfully, but these errors were encountered: