I don't think errors thrown by the user-provided transforming method are correctly being passed to the callback of _transform. For example if use node-stream-transform as follows:
Where the returned pipeline promise was caught outside of the function. Since the transform stream did not properly close, the pipeline did not close the source and destination streams as expected. When I replace the use of node-stream-transform with a regular stream.Transform, everything works as expected:
I don't think errors thrown by the user-provided transforming method are correctly being passed to the callback of
_transform
. For example if usenode-stream-transform
as follows:The stream will not properly close due to the error. The error event is emitted in the
__done
method here: https://github.com/adaltas/node-stream-transform/blob/master/lib/index.js#L172. But looking at the node documentation, the callback for_transform
should also be called if an error occurs during while processing the input: https://nodejs.org/docs/latest-v10.x/api/stream.html#stream_transform_transform_chunk_encoding_callback. I think that means the__done
method should also be callingcb(err)
.I ran into this issue using
node-stream-transform
in combination withstream.pipeline
. Building on the example above, I had something like this:Where the returned pipeline promise was caught outside of the function. Since the transform stream did not properly close, the pipeline did not close the
source
anddestination
streams as expected. When I replace the use ofnode-stream-transform
with a regularstream.Transform
, everything works as expected:Thoughts?