From cafb195b5c864a0f25ef74fd9f5a53afe6aff9c3 Mon Sep 17 00:00:00 2001 From: Eric Fernandez Date: Fri, 21 Jun 2019 14:57:06 -0300 Subject: [PATCH] catch err on readFile --- watch/index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/watch/index.js b/watch/index.js index d2bea3b..41d5580 100644 --- a/watch/index.js +++ b/watch/index.js @@ -12,6 +12,11 @@ module.exports = function (dir, callback) { fs.readFile(file, 'utf8', function (err, fileString) { + if (err) { + console.log('ERROR', err); + return; + } + callback(fileString, file); }); } -- 1.9.1