handle errors

This commit is contained in:
Iuri Matias 2016-10-30 22:04:25 -04:00
parent c7bd478dde
commit 59f9d9fdf0
1 changed files with 20 additions and 8 deletions

View File

@ -40,10 +40,6 @@ var Embark = {
this.config = new Config({env: env});
this.config.loadConfigFiles(options);
this.logger = new Logger({logLevel: 'debug'});
//this.contractsManager = new ContractsManager(configDir, files, env);
//this.contractsManager.init();
//return this.contractsManager;
},
redeploy: function(env) {
@ -55,7 +51,11 @@ var Embark = {
},
self.buildDeployGenerate.bind(self)
], function(err, result) {
self.logger.trace("finished".underline);
if (err) {
self.logger.error(err.message);
} else {
self.logger.trace("finished".underline);
}
});
},
@ -130,12 +130,17 @@ var Embark = {
callback();
}
], function(err, result) {
self.logger.setStatus("Ready".green);
self.logger.trace("finished".underline);
if (err) {
self.logger.error(err.message);
} else {
self.logger.setStatus("Ready".green);
self.logger.trace("finished".underline);
}
});
},
build: function(env) {
var self = this;
async.waterfall([
function deployAndGenerateABI(callback) {
Embark.deploy(function(abi) {
@ -148,7 +153,11 @@ var Embark = {
callback();
}
], function(err, result) {
self.logger.trace("finished".underline);
if (err) {
self.logger.error(err.message);
} else {
self.logger.trace("finished".underline);
}
});
},
@ -224,6 +233,9 @@ var Embark = {
callback(null, abiGenerator.generateABI({useEmbarkJS: true}));
}
], function(err, result) {
if (err) {
self.logger.error(err.message);
}
done(result);
});
},