better display error contract deployment errors in the dashbord

This commit is contained in:
Iuri Matias 2017-12-14 15:03:08 -05:00
parent c2c2635acd
commit 1cb6581fde
3 changed files with 5 additions and 3 deletions

View File

@ -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 {

View File

@ -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);
});

View File

@ -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/",