Improve debug output for writables

master
Sven Slootweg 3 years ago
parent feb632897b
commit 3ed16ea1eb

@ -91,12 +91,16 @@ function fromWritable(stream) {
// NOTE: The use of `var` is intentional, to make hoisting possible here; otherwise we'd have a broken cyclical reference
var writable = wireUpWritableInterface(stream, {
onEnd: () => {
debugWritable(`Underlying stream has reported a close event (upstreamHasEnded = ${upstreamHasEnded})`);
if (!upstreamHasEnded) {
debugWritable(`Issuing happy abort on converted stream`);
convertedStream.abort(true, mostRecentSource);
}
},
onError: (error) => {
// Make sure we notify the pipeline, if any, by passing in the most recent source stream that we've seen.
debugWritable(`Issuing error abort on converted stream due to: ${error.message}`);
convertedStream.abort(error, mostRecentSource);
}
});

Loading…
Cancel
Save