Skip to content

Commit

Permalink
[api fix] More verbose errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
indexzero committed Mar 5, 2013
1 parent f61bc99 commit 0f7b571
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/dependencies.js
Expand Up @@ -38,7 +38,7 @@ var dependencies = module.exports = function (options, callback) {

client.get(name, function (err, system) {
if (err) {
return next(err)
return next(new Error('Error fetching ' + name + ': ' + err.message.replace(/Error /, '')));
}

var versions = Object.keys(system.versions),
Expand Down
10 changes: 7 additions & 3 deletions lib/remote-dependencies.js
Expand Up @@ -200,8 +200,12 @@ exports.verifyRunlist = function (options, callback) {
return !config[name];
});

return missing.length
? callback(new Error('Missing remoteDependencies: ' + missing.join(', ')))
: callback(null, satisfying);
if (missing.length) {
err = new Error('Missing remoteDependencies: ' + missing.join(', '));
err.missing = missing;
return callback(err);
}

callback(null, satisfying);
});
};

0 comments on commit 0f7b571

Please sign in to comment.