dominictarr / JSONStream

rawStream.pipe(JSONStream.parse()).pipe(streamOfObjects)
Other
1.91k stars 165 forks source link

Not all jsonparse errors are handled by JSONStream #136

Open ataube opened 7 years ago

ataube commented 7 years ago

The underlying jsonparse lib triggers one specific error which is not handled by JSONStream: Look here: https://github.com/creationix/jsonparse/blob/master/jsonparse.js#L321

And here: https://github.com/dominictarr/JSONStream/blob/master/index.js#L140

It would be helpful if JSONStream could also wrap this error as an Invalid JSON message to have a consistent error contract one can check for.

dominictarr commented 7 years ago

sure, I would be happy to merge this pull request!