lucagrulla / node-tail

The zero dependency Node.js module for tailing a file
https://www.lucagrulla.com/node-tail/
MIT License
467 stars 75 forks source link

Add try/catch to watchEvent #147

Closed chriskinsman closed 2 years ago

chriskinsman commented 2 years ago

The watchEvent method is an event handler for fs.watch().

It has no try/catch handler around it. When change() throws due to a ENOENT there is nothing to catch the exception which causes the process to terminate.

Added a try/catch around watchEvent and both log and emit any errors that are raised.

143

chriskinsman commented 2 years ago

@lucagrulla, Any chance you could check this out and merge it? Fixes issues in our consumption of this package.

Thanks!

lucagrulla commented 2 years ago

Hello @chriskinsman I might have some time over the weekend to review, merge and release.

Thanks, Luca

chriskinsman commented 2 years ago

Thanks! Will leave you alone until 10/11!