hypercore-protocol / hyperdrive-daemon

Hyperdrive, batteries included.
MIT License
156 stars 23 forks source link

Pass errors from createReadStream() into response #16

Closed pfrazee closed 4 years ago

pfrazee commented 4 years ago

Currently createReadStream() will not propagate an error when it should, eg if you call it on a file that does not exist. This PR causes the error to be correctly passed into the responding stream. (I would've expected pump() to do that but for some reason it doesn't).

andrewosh commented 4 years ago

Strange that pump isn't handling this, but merging.

mafintosh commented 4 years ago

Pump does propagate it using call.destroy. If this was indeed needed it looks to me like some other bug. This needs a test case imo