diff --git a/lib/contracts/contracts.js b/lib/contracts/contracts.js index 9940e809..1a167be8 100644 --- a/lib/contracts/contracts.js +++ b/lib/contracts/contracts.js @@ -204,7 +204,16 @@ class ContractsManager { } } - let orderedDependencies = toposort(converted_dependencies).reverse(); + let orderedDependencies; + + try { + orderedDependencies = toposort(converted_dependencies).reverse(); + } catch(e) { + this.logger.error(("Error: " + e.message).red); + this.logger.error("there are two or more contracts that depend on each other in a cyclic manner".bold.red); + this.logger.error("Embark couldn't determine which one to deploy first".red); + process.exit(0); + } let newList = contractList.sort(function (a, b) { let order_a = orderedDependencies.indexOf(a.className); diff --git a/lib/contracts/deploy_manager.js b/lib/contracts/deploy_manager.js index 08bc2075..54860326 100644 --- a/lib/contracts/deploy_manager.js +++ b/lib/contracts/deploy_manager.js @@ -55,6 +55,7 @@ class DeployManager { function setDefaultAccount(contractsManager, web3, callback) { web3.eth.getAccounts(function (err, accounts) { if (err) { + self.logger.error(err); return callback(new Error(err)); } let accountConfig = self.config.blockchainConfig.account; diff --git a/lib/core/test_logger.js b/lib/core/test_logger.js index e83c5e00..ce342eb6 100644 --- a/lib/core/test_logger.js +++ b/lib/core/test_logger.js @@ -25,6 +25,7 @@ class TestLogger { if (!(this.shouldLog('error'))) { return; } + console.error(txt); this.logFunction(txt.red); }