finnp/format-data — pull request #2 by maxogden (2014-12-17 23:32:09+00:00)
Title: destroy/error handling

this is just for discussion purposes right now

discussion: how do you think we should handle errors in streaming JSON REST APIs? e.g. say a leveldb readstream has an error halfway through being piped into this https://github.com/finnp/format-data/blob/master/json.js, what should the response be?

this adds a simple test that tries to destroy the stream.

one problem I see with this is: what if you have a legitimate piece of data with a key `error`? how would you differentiate between real data and actual errors in that case?

also currently the `json` formatter in this repo doesnt implement `.destroy` so the tests crash ATM