pass errors so that we have stack traces

This commit is contained in:
Konstantin Käfer 2011-07-12 15:40:42 +02:00
parent 02b4ff4008
commit 6f5d62473d

View File

@ -148,7 +148,7 @@ External.prototype.findByExtension = function(ext, callback) {
External.mkdirp = function mkdirP(p, mode, f) {
var cb = f || function() {};
if (p.charAt(0) != '/') {
cb('Relative path: ' + p);
cb(new Error('Relative path: ' + p));
return;
}
@ -304,7 +304,7 @@ External.processors['.zip'] = function(ext, callback) {
var uncompressed = path.join(destPath, name);
External.mkdirp(path.dirname(uncompressed), 0755, function(err) {
if (err && err.errno != constants.EEXIST) {
callback("Couldn't create directory " + path.dirname(name));
callback(new Error("Couldn't create directory " + path.dirname(name)));
} else {
// if just a directory skip ahead
if (!path.extname(name) || name[0] === '.') {