alanshaw / stream-to-it

🚰 Convert Node.js streams to streaming iterables
Other
18 stars 6 forks source link

fix: do not pass error to stream.destroy in sink #8

Closed achingbrain closed 4 years ago

achingbrain commented 4 years ago

Don't pass the error to the stream's destroy method as that would cause an error event to be emitted by the stream on the next tick by which point we've removed our error listener and it can result in an uncaught error.

achingbrain commented 4 years ago

Fixes https://github.com/ipfs/js-ipfs/issues/3169

cc: @jacobheun @gozala