Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Unhandled Promise Rejections coming from sdk-middleware-http

Aperta
#1,858 1 commento 1 reazione 1 assegnatario Vedi su GitHub

@ajimae ci sta già lavorando.

Dal 14/6/2023.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

Type: Bug
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. https://github.com/node-fetch/node-fetch/issues/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.

Lingua principale
JavaScript
Stelle
78
Fork
70
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di commercetools/nodejs

Tutte le issue di commercetools/nodejs

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.