From d05cf90b5b8e1224a49e3014f5315c01a330a04d Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Fri, 21 Oct 2016 07:16:15 -0400 Subject: [PATCH] display error in contract status --- lib/contracts.js | 6 ++++++ lib/deploy.js | 3 +++ 2 files changed, 9 insertions(+) diff --git a/lib/contracts.js b/lib/contracts.js index 3271d3f0..c4c1eae2 100644 --- a/lib/contracts.js +++ b/lib/contracts.js @@ -185,6 +185,12 @@ ContractsManager.prototype.contractsState = function() { 'Interface or set to not deploy'.green, "\t\tn/a".green ] + } else if (contract.error) { + contractData = [ + className.green, + (contract.error).red, + '\t\tError'.red + ] } else { contractData = [ className.green, diff --git a/lib/deploy.js b/lib/deploy.js index 0fdaf4b3..5651f130 100644 --- a/lib/deploy.js +++ b/lib/deploy.js @@ -18,6 +18,8 @@ var Deploy = function(options) { Deploy.prototype.checkAndDeployContract = function(contract, params, callback) { var self = this; + contract.error = false; + if (contract.deploy === false) { self.logger.contractsState(self.contractsManager.contractsState()); return callback(); @@ -122,6 +124,7 @@ Deploy.prototype.deployContract = function(contract, params, callback) { if (err) { self.logger.error("error deploying contract: " + contract.className); self.logger.error(err.toString()); + contract.error = err.toString(); callback(new Error(err)); } else if (transaction.address !== undefined) { self.logger.info(contract.className + " deployed at " + transaction.address);