From 2d35f16785b41e7a2694f60608d01bd9afb6359b Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Fri, 19 Nov 2021 19:21:11 +0100 Subject: [PATCH] fixup --- lib/internal/streams/pipeline.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/internal/streams/pipeline.js b/lib/internal/streams/pipeline.js index 85b07a55e97bb1..917c26f2c7659c 100644 --- a/lib/internal/streams/pipeline.js +++ b/lib/internal/streams/pipeline.js @@ -330,16 +330,20 @@ function pipe(src, dst) { src .on('end', end) - .on('readable', pump); + .on('readable', pump) + .on('error', cleanup); dst - .on('drain', pump); + .on('drain', pump) + .on('error', cleanup); function cleanup() { src .off('end', end) - .off('readable', pump); + .off('readable', pump) + .off('error', cleanup); dst - .off('drain', pump); + .off('drain', pump) + .off('error', cleanup); } function end() {