Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled Promise Rejections coming from sdk-middleware-http #1858

Open
fragglebob opened this issue Jun 12, 2023 · 1 comment
Open

Unhandled Promise Rejections coming from sdk-middleware-http #1858

fragglebob opened this issue Jun 12, 2023 · 1 comment
Assignees

Comments

@fragglebob
Copy link

Description

There is no promise rejection handling around the conversion of a HTTP response to text with res.text() in sdk-middleware-http. This causes an unhandled promise rejection when that call fails.

The route cause for this rejection is an issuing in the version of node we are using, in how chunked HTTP responses are handled with node-fetch. node-fetch/node-fetch#1219

A rather hard error to replicate, but it's to do with a "Premature Close" happening when reading from response body in the call to res.text().

Expected Behavior

The normal error handling happens. So retries if applicable, etc.

Current Behavior

A unhandled promise rejection happens, crashing the process in Node 16+

Context

~50 unhandled promise rejection per day.

@ajimae ajimae self-assigned this Jun 14, 2023
@ajimae
Copy link
Contributor

ajimae commented Jun 14, 2023

HI @fragglebob

Thanks for reporting this issue.

I will raise a PR to fix this ASAP.

Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants