Destroy streams handled by getReadyPipeline on error

This commit is contained in:
Simon Detheridge 2020-03-30 17:14:46 +01:00
parent 87b8f8e194
commit 5fadafaf96

View file

@ -112,6 +112,11 @@ function getReadyPipeline(...streams) {
}
resolve(lastStream)
}
if (err) {
for (const stream of streams) {
stream.destroy()
}
}
}
pipeline(...streams).catch(handler)