sindresorhus / get-stream

Get a stream as a string, Buffer, ArrayBuffer or array
MIT License
341 stars 33 forks source link

Reject promise when input stream emits an error #15

Closed darsain closed 8 years ago

darsain commented 8 years ago

Input stream errors are not caught so they hang the promise, which never resolves or rejects. Got bitten by this right now.

darsain commented 8 years ago

Ugh, I just copy & pasted your code, failing to notice it has arrow function, so tests fail on older node versions :) sec

darsain commented 8 years ago

Also added that handler to stream error event, just in case.

jamestalmage commented 8 years ago

This all LGTM! One last comment on the wording in the docs, then I think we are good to go.

(You are responding so fast!)

darsain commented 8 years ago

Yeah 2am here. Hope it's good, cause I'm going to sleep and want to use this module in the morning :)

sindresorhus commented 8 years ago

James, can you publish a new version? I'm on my phone.

jamestalmage commented 8 years ago

Yep.

jamestalmage commented 8 years ago

Published in 2.3.0.

@darsain - I made the buffer => bufferedData myself. Thanks so much for the PR!

darsain commented 8 years ago

Thanks for quick merge and new version :)