Permalink
Browse files

[fix] Minor changes to ensure errors are in-fact errors

  • Loading branch information...
1 parent 9644a5c commit 64e031b9f43adc9eb1068f5323005c79b28020c0 @indexzero indexzero committed Nov 17, 2012
Showing with 8 additions and 4 deletions.
  1. +2 −2 bin/blacksmith
  2. +6 −2 lib/blacksmith/site.js
View
@@ -26,10 +26,10 @@ require('../lib/blacksmith')({
dir: root,
since: app.argv.since
}, function (err) {
- if (err) {
+ if (err && err instanceof Error) {
console.log('Error rendering: ' + root);
console.dir(err);
- console.dir(err.stack.split('\n'));
+ console.dir(err.stack && err.stack.split('\n'));
return;
}
@@ -207,7 +207,7 @@ Site.prototype.render = function (callback) {
function writeFiles(rendered, next) {
self.writeFiles(rendered, next);
},
- ], function (err) {
+ ], function (err, _) {
return err ? callback(err) : callback();
});
@@ -443,7 +443,11 @@ Site.prototype.writeFiles = function (rendered, callback) {
});
}
},
- done
+ function (err) {
+ return err instanceof Error
+ ? done(err)
+ : done();
+ }
);
}
], function (err) {

0 comments on commit 64e031b

Please sign in to comment.