display error in contract status

This commit is contained in:
Iuri Matias 2016-10-21 07:16:15 -04:00
parent 907a358e5b
commit d05cf90b5b
2 changed files with 9 additions and 0 deletions

View File

@ -185,6 +185,12 @@ ContractsManager.prototype.contractsState = function() {
'Interface or set to not deploy'.green, 'Interface or set to not deploy'.green,
"\t\tn/a".green "\t\tn/a".green
] ]
} else if (contract.error) {
contractData = [
className.green,
(contract.error).red,
'\t\tError'.red
]
} else { } else {
contractData = [ contractData = [
className.green, className.green,

View File

@ -18,6 +18,8 @@ var Deploy = function(options) {
Deploy.prototype.checkAndDeployContract = function(contract, params, callback) { Deploy.prototype.checkAndDeployContract = function(contract, params, callback) {
var self = this; var self = this;
contract.error = false;
if (contract.deploy === false) { if (contract.deploy === false) {
self.logger.contractsState(self.contractsManager.contractsState()); self.logger.contractsState(self.contractsManager.contractsState());
return callback(); return callback();
@ -122,6 +124,7 @@ Deploy.prototype.deployContract = function(contract, params, callback) {
if (err) { if (err) {
self.logger.error("error deploying contract: " + contract.className); self.logger.error("error deploying contract: " + contract.className);
self.logger.error(err.toString()); self.logger.error(err.toString());
contract.error = err.toString();
callback(new Error(err)); callback(new Error(err));
} else if (transaction.address !== undefined) { } else if (transaction.address !== undefined) {
self.logger.info(contract.className + " deployed at " + transaction.address); self.logger.info(contract.className + " deployed at " + transaction.address);