From 10be672884552d90d81d21321b09c47bf07729aa Mon Sep 17 00:00:00 2001 From: greguz Date: Tue, 21 Jun 2022 11:02:00 +0200 Subject: [PATCH] stream: pass error on legacy destroy --- lib/internal/streams/destroy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/streams/destroy.js b/lib/internal/streams/destroy.js index 10f5471e21d3eb..5c352135dc3012 100644 --- a/lib/internal/streams/destroy.js +++ b/lib/internal/streams/destroy.js @@ -319,7 +319,7 @@ function destroyer(stream, err) { // TODO: Don't lose err? stream.close(); } else if (err) { - process.nextTick(emitErrorCloseLegacy, stream); + process.nextTick(emitErrorCloseLegacy, stream, err); } else { process.nextTick(emitCloseLegacy, stream); }