sindresorhus / get-stream

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

Make errors distinguishable #25

Closed tjconcept closed 6 years ago

tjconcept commented 6 years ago

Could the errors (particularly maxBuffer exceeded) have specific classes so that they can more easily be caught downstream?

I'm wondering if there's a reason you're not using this pattern? Do you normally use the message to decide which errors to handle and which to pass through?

sindresorhus commented 6 years ago

No reason other than not thinking about it. PR welcome.