Skip to content

Commit 317449e

Browse files
committed
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.
1 parent 8997476 commit 317449e

File tree

1 file changed

+14
-19
lines changed

1 file changed

+14
-19
lines changed

lib/modules/deployment/index.js

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -81,25 +81,20 @@ class DeployManager {
8181
contractDeploys[className].push(deploy);
8282
});
8383

84-
try {
85-
async.auto(contractDeploys, 1, function(_err, _results) {
86-
if (errors.length) {
87-
_err = __("Error deploying contracts. Please fix errors to continue.");
88-
self.logger.error(_err);
89-
self.events.emit("outputError", __("Error deploying contracts, please check console"));
90-
return done(_err);
91-
}
92-
if (contracts.length === 0) {
93-
self.logger.info(__("no contracts found"));
94-
return done();
95-
}
96-
self.logger.info(__("finished deploying contracts"));
97-
done(err);
98-
});
99-
} catch (e) {
100-
self.logger.error(e.message || e);
101-
done(__('Error deploying'));
102-
}
84+
async.auto(contractDeploys, 1, function(_err, _results) {
85+
if (errors.length) {
86+
_err = __("Error deploying contracts. Please fix errors to continue.");
87+
self.logger.error(_err);
88+
self.events.emit("outputError", __("Error deploying contracts, please check console"));
89+
return done(_err);
90+
}
91+
if (contracts.length === 0) {
92+
self.logger.info(__("no contracts found"));
93+
return done();
94+
}
95+
self.logger.info(__("finished deploying contracts"));
96+
done(err);
97+
});
10398
}
10499
]);
105100
});

0 commit comments

Comments
 (0)