Permalink
Browse files

added error todo

  • Loading branch information...
1 parent 3acb2b8 commit c2161298a8dc9f094d798c3d16e834325bdf55ef @thlorenz committed Aug 23, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 watcher.js
View
@@ -39,8 +39,8 @@ Watcher.prototype.watchTemplatesAndPartials = function () {
function keepWarm(file, process) {
watch(file, 'change', function (file) {
- fs.readFile(file.fullPath,function (err, content) {
- if (err) cb(err);
+ fs.readFile(file.fullPath, function (err, content) {
+ if (err) process(err);
else process(file, content.toString());
});
});
@@ -49,6 +49,7 @@ Watcher.prototype.watchTemplatesAndPartials = function () {
function watchTemplates(watchingAll) {
self.templateFiles.forEach(function (file) {
keepWarm(file, function (err, plate) {
+ // TODO: if error emit it
self.emit('templateChanged', file, plate);
self.emit('fileChanged', file, plate);
});

0 comments on commit c216129

Please sign in to comment.