Permalink
Browse files

stop showing EPIPE

  • Loading branch information...
1 parent 574055d commit e622215b4ddc6ad1bab65d03fdf83396ed7bbe9f @tricknotes tricknotes committed May 27, 2012
Showing with 8 additions and 0 deletions.
  1. +8 −0 lib/jsonCommand.js
View
8 lib/jsonCommand.js
@@ -452,8 +452,16 @@ JSON.Command.prototype.processInput = function() {
}
});
+ var handleEPIPE = function(e) {
+ if (e.code !== "EPIPE") {
+ process.emit("error", e);
+ }
+ };
+ process.stdout.on("error", handleEPIPE);
+
this.stdin.on("end", function() {
this.jsonC.processObjects([this.jsonC.buffer, null]);
+ process.stdout.removeListener("error", handleEPIPE);
});
}
};

0 comments on commit e622215

Please sign in to comment.