diff options
Diffstat (limited to 'ext/node/polyfills/http.ts')
-rw-r--r-- | ext/node/polyfills/http.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/node/polyfills/http.ts b/ext/node/polyfills/http.ts index f4126241e..e0ddedef8 100644 --- a/ext/node/polyfills/http.ts +++ b/ext/node/polyfills/http.ts @@ -1642,7 +1642,9 @@ export class IncomingMessageForServer extends NodeReadable { } }, destroy: (err, cb) => { - reader?.cancel().finally(() => cb(err)); + reader?.cancel().catch(() => { + // Don't throw error - it's propagated to the user via 'error' event. + }).finally(nextTick(onError, this, err, cb)); }, }); // TODO(@bartlomieju): consider more robust path extraction, e.g: |