Permalink
Browse files

Merge pull request #9 from tricknotes/stop-showing-epipe

stop showing EPIPE
  • Loading branch information...
2 parents 574055d + e622215 commit 056fc2d9d85d00cab80dea55cd144a358a8ec48e @zpoley committed May 29, 2012
Showing with 8 additions and 0 deletions.
  1. +8 −0 lib/jsonCommand.js
View
@@ -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 056fc2d

Please sign in to comment.