Permalink
Browse files

[fix] Don't ignore exceptions thrown by `data` handler

  • Loading branch information...
1 parent 209598f commit 37e26f23e1d4e8911d547c2e3450895ca8633e7c @mmalecki committed Nov 24, 2012
Showing with 5 additions and 2 deletions.
  1. +5 −2 lib/json-stream.js
View
@@ -27,9 +27,12 @@ JSONStream.prototype.write = function (data) {
lines.forEach(function(line) {
try {
- that.emit('data', JSON.parse(line));
+ line = JSON.parse(line);
}
- catch (_) { }
+ catch (_) {
+ return;
+ }
+ that.emit('data', line);
});
return !this.paused;

0 comments on commit 37e26f2

Please sign in to comment.