Fix bug that interrupts error handling early

master
Sven Slootweg 3 years ago
parent 53891f2347
commit 4f89083282

@ -66,6 +66,7 @@ module.exports = function simpleSinkStream(_options) {
return attemptRead();
}).catch(isEndOfStream, (error) => {
/* Don't attempt to do another read, we're done. */
return Promise.try(() => {
if (!onEndCalled && onEnd != null) {
onEndCalled = true;
@ -77,10 +78,11 @@ module.exports = function simpleSinkStream(_options) {
}
});
}
}).then(() => {
return resultBuffer.maybeRead(() => {
throw error;
});
});
}).catch((error) => !isAborted(error), (error) => {
return Promise.try(() => {
return source.abort(error);

Loading…
Cancel
Save