exit on EPIPE to avoid useless work
This commit is contained in:
parent
c5bfdc4cf3
commit
74d3935348
2 changed files with 3 additions and 1 deletions
|
@ -8,7 +8,8 @@ Known issues:
|
||||||
|
|
||||||
## bunyan 0.16.9 (not yet released)
|
## bunyan 0.16.9 (not yet released)
|
||||||
|
|
||||||
(nothing yet)
|
- *Exit* on EPIPE, otherwise we sit there useless processing a huge log file
|
||||||
|
with, e.g. `bunyan huge.log | head`.
|
||||||
|
|
||||||
|
|
||||||
## bunyan 0.16.8
|
## bunyan 0.16.8
|
||||||
|
|
|
@ -910,6 +910,7 @@ function emit(s) {
|
||||||
process.stdout.on("error", function (err) {
|
process.stdout.on("error", function (err) {
|
||||||
if (err.code === "EPIPE") {
|
if (err.code === "EPIPE") {
|
||||||
// Pass. See <https://github.com/trentm/json/issues/9>.
|
// Pass. See <https://github.com/trentm/json/issues/9>.
|
||||||
|
drainStdoutAndExit(0);
|
||||||
} else {
|
} else {
|
||||||
warn(err);
|
warn(err);
|
||||||
drainStdoutAndExit(1);
|
drainStdoutAndExit(1);
|
||||||
|
|
Loading…
Reference in a new issue