Skip to content

Commit

Permalink
chore: better handle errors from chokidar
Browse files Browse the repository at this point in the history
  • Loading branch information
remy committed Oct 19, 2015
1 parent d98301d commit f1684b2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
11 changes: 11 additions & 0 deletions lib/monitor/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,17 @@ function watch() {
resolve(total);
});

watcher.on('error', function (error) {
if (error.code === 'EINVAL') {
utils.log.error('Internal watch failed. Likely cause: too many ' +
'files being watched (perhaps from the root of a drive?\n' +
'See https://github.com/paulmillr/chokidar/issues/229 for details');
} else {
utils.log.error('Internal watch failed: ' + error.message);
process.exit(1);
}
});

watchers.push(watcher);
});
promises.push(promise);
Expand Down
3 changes: 2 additions & 1 deletion lib/version.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
var version = require('../package.json').version || 'development';
module.exports = version === 'development' ? version + ' version' : 'v' + version;
module.exports = version === 'development' ? version + ' version' : 'v' +
version;

0 comments on commit f1684b2

Please sign in to comment.