Skip to content

Commit

Permalink
fix: don't crash/terminate upon errors within chokidar
Browse files Browse the repository at this point in the history
Handle errors from chokidar and route them to the console. Previously,
these unhandled errors (which are very common when editing in Visual
Studio) would cause karma to terminate and all browsers to vanish. Fixes
#959
  • Loading branch information
DanTup committed Apr 12, 2014
1 parent 337a538 commit 2c38931
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/watcher.js
Expand Up @@ -94,7 +94,12 @@ exports.watch = function(patterns, excludes, fileList, usePolling) {
// register events
chokidarWatcher.on('add', bind(fileList.addFile))
.on('change', bind(fileList.changeFile))
.on('unlink', bind(fileList.removeFile));
.on('unlink', bind(fileList.removeFile))
// If we don't subscribe; unhandled errors from Chokidar will bring Karma down
// (see GH Issue #959)
.on('error', function(e) {
log.debug(e);
});

return chokidarWatcher;
};
Expand Down

0 comments on commit 2c38931

Please sign in to comment.