diff --git a/packages/core/src/engine.js b/packages/core/src/engine.js index db1d1c2d..ed7b4296 100644 --- a/packages/core/src/engine.js +++ b/packages/core/src/engine.js @@ -152,7 +152,9 @@ export default class Engine extends SafeTransform { debug('ezs')(`Ignoring error at item #${currentIndex}`); return this.push(createErrorWith(data, currentIndex, this.funcName, chunk)); } - return this.push(data); + if (!this.errorWasSent) { + return this.push(data); + } }; const wait = async () => { this.pause(); diff --git a/packages/core/src/statements/fork.js b/packages/core/src/statements/fork.js index 8171129c..918823a0 100644 --- a/packages/core/src/statements/fork.js +++ b/packages/core/src/statements/fork.js @@ -49,8 +49,8 @@ export default function fork(data, feed) { this.whenFinish = new Promise((resolve) => output .pipe(ezs.catch((e) => feed.write(e))) // avoid to break pipeline at each error .once('error', (e) => feed.stop(e)) - .once('end', resolve) .on('data', () => true) + .once('end', resolve) ); } }