Compare commits

...

2 Commits

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

@ -1,6 +1,6 @@
{ {
"name": "@promistream/simple-sink", "name": "@promistream/simple-sink",
"version": "0.2.0", "version": "0.2.1",
"main": "index.js", "main": "index.js",
"repository": "http://git.cryto.net/promistream/simple-sink.git", "repository": "http://git.cryto.net/promistream/simple-sink.git",
"author": "Sven Slootweg <admin@cryto.net>", "author": "Sven Slootweg <admin@cryto.net>",

Loading…
Cancel
Save