refactor(@embark/deployment): remove try/catch block

This code didn't really make sense in the first place as we use `async.auto()` at the
moment for callback based error handling.
This commit is contained in:
Pascal Precht 2018-11-08 14:14:31 +01:00 committed by Pascal Precht
parent 8997476e33
commit 317449e840
1 changed files with 14 additions and 19 deletions

View File

@ -81,25 +81,20 @@ class DeployManager {
contractDeploys[className].push(deploy);
});
try {
async.auto(contractDeploys, 1, function(_err, _results) {
if (errors.length) {
_err = __("Error deploying contracts. Please fix errors to continue.");
self.logger.error(_err);
self.events.emit("outputError", __("Error deploying contracts, please check console"));
return done(_err);
}
if (contracts.length === 0) {
self.logger.info(__("no contracts found"));
return done();
}
self.logger.info(__("finished deploying contracts"));
done(err);
});
} catch (e) {
self.logger.error(e.message || e);
done(__('Error deploying'));
}
async.auto(contractDeploys, 1, function(_err, _results) {
if (errors.length) {
_err = __("Error deploying contracts. Please fix errors to continue.");
self.logger.error(_err);
self.events.emit("outputError", __("Error deploying contracts, please check console"));
return done(_err);
}
if (contracts.length === 0) {
self.logger.info(__("no contracts found"));
return done();
}
self.logger.info(__("finished deploying contracts"));
done(err);
});
}
]);
});