handle copyStreamError

This commit is contained in:
SPRINX0\prochazka
2025-03-04 08:58:04 +01:00
parent 3f3160406f
commit 69f781d3de
2 changed files with 28 additions and 3 deletions

View File

@@ -33,6 +33,19 @@ function copyStream(input, output, options) {
return new Promise((resolve, reject) => {
const finisher = output['finisher'] || output;
finisher.on('finish', resolve);
input.on('error', err => {
// console.log('&&&&&&&&&&&&&&&&&&&&&&& CATCH ERROR IN COPY STREAM &&&&&&&&&&&&&&&&&&&&&&');
// console.log(err);
process.send({
msgtype: 'copyStreamError',
runid: this.runid,
copyStreamError: err,
});
});
input.on('error', reject);
finisher.on('error', reject);
let lastStream = input;