mirror of https://github.com/mthenw/frontail.git
simplify error catching
parent
82618c8cc9
commit
2bfb6b1c51
|
@ -20,14 +20,10 @@ var Tail = function (path, options) {
|
|||
tail = spawn('tail', ['-n', options.buffer, '-F', path]);
|
||||
}
|
||||
|
||||
tail.on('close', function () {
|
||||
//kill the process if the tail is closed
|
||||
process.exit();
|
||||
});
|
||||
|
||||
tail.stderr.on('data', function (data) {
|
||||
//if there is any error then display it in the console.
|
||||
//if there is any error then display it in the console and then kill the tail.
|
||||
console.error(data.toString());
|
||||
process.exit();
|
||||
});
|
||||
|
||||
tail.stdout.on('data', function (data) {
|
||||
|
|
Loading…
Reference in New Issue