From 1cb6581fdeec6538066a6405fdc15f24f59a88cb Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Thu, 14 Dec 2017 15:03:08 -0500 Subject: [PATCH] better display error contract deployment errors in the dashbord --- lib/contracts/contracts.js | 2 +- lib/contracts/deploy.js | 4 +++- package.json | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/contracts/contracts.js b/lib/contracts/contracts.js index 36ab312b5..b831097c6 100644 --- a/lib/contracts/contracts.js +++ b/lib/contracts/contracts.js @@ -223,7 +223,7 @@ class ContractsManager { } else if (contract.error) { contractData = [ className.green, - (contract.error).red, + (contract.error).split("\n")[0].replace(/Error: /g, '').substring(0, 32).red, '\t\tError'.red ]; } else { diff --git a/lib/contracts/deploy.js b/lib/contracts/deploy.js index c9ea7ada0..c6f31dfbd 100644 --- a/lib/contracts/deploy.js +++ b/lib/contracts/deploy.js @@ -127,7 +127,6 @@ class Deploy { self.logger.info("deploying " + contract.className.bold.cyan + " with ".green + contract.gas + " gas".green); contractParams.push(function (err, transaction) { - self.logger.contractsState(self.contractsManager.contractsState()); if (err) { self.logger.error("error deploying contract: " + contract.className.cyan); @@ -137,14 +136,17 @@ class Deploy { } self.logger.error(errMsg); contract.error = errMsg; + self.logger.contractsState(self.contractsManager.contractsState()); return callback(new Error(err)); } else if (transaction.address !== undefined) { self.logger.info(contract.className.bold.cyan + " deployed at ".green + transaction.address.bold.cyan); contract.deployedAddress = transaction.address; contract.transactionHash = transaction.transactionHash; + self.logger.contractsState(self.contractsManager.contractsState()); return callback(null, transaction.address); } }); + self.logger.contractsState(self.contractsManager.contractsState()); contractObject["new"].apply(contractObject, contractParams); }); diff --git a/package.json b/package.json index bc20e3790..8c3abfa46 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "embark", - "version": "2.6.1", + "version": "2.7.0", "description": "Embark is a framework that allows you to easily develop and deploy DApps", "scripts": { "lint": "./node_modules/.bin/eslint lib/",