pluginfw/installer.js: Don't freak out users with cryptic errors, just use the error message

This commit is contained in:
Marcel Klehr 2013-01-24 22:40:31 +01:00
parent fa55cd4759
commit 23dd4c73e2

View file

@ -15,7 +15,10 @@ var withNpm = function (npmfn, final, cb) {
cb({progress: 0.5, message:message.msg + ": " + message.pref});
});
npmfn(function (er, data) {
if (er) return cb({progress:1, error:er.code + ": " + er.path});
if (er) {
console.error(er);
return cb({progress:1, error: er.message});
}
if (!data) data = {};
data.progress = 1;
data.message = "Done.";