mirror of https://github.com/embarklabs/embark.git
warn about cycling dependencies
This commit is contained in:
parent
eb43fa2526
commit
52953a1d0d
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -25,6 +25,7 @@ class TestLogger {
|
|||
if (!(this.shouldLog('error'))) {
|
||||
return;
|
||||
}
|
||||
console.error(txt);
|
||||
this.logFunction(txt.red);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue