Skip to content

Commit e207537

Browse files
jrainvilleiurimatias
authored andcommitted
fix(profiler): do not exit on error but print it
1 parent b0c226a commit e207537

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/lib/modules/profiler/gasEstimator.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ class GasEstimator {
3333
contractObj.methods[name]
3434
.apply(contractObj.methods[name], [])
3535
.estimateGas((err, gasAmount) => {
36-
if (err) return gasCb(err, name, abiMethod.type);
36+
if (err) {
37+
self.logger.error(`Error getting gas estimate for "${name}"`, err.message || err);
38+
return gasCb(null, name, abiMethod.type);
39+
}
3740
gasMap[name] = gasAmount;
3841
return gasCb(null, name, abiMethod.type);
3942
});
@@ -42,7 +45,10 @@ class GasEstimator {
4245
async.concat(fuzzMap[name], (values, getVarianceCb) => {
4346
contractObj.methods[name].apply(contractObj.methods[name], values)
4447
.estimateGas((err, gasAmount) => {
45-
getVarianceCb(err, gasAmount);
48+
if (err) {
49+
self.logger.error(`Error getting gas estimate for "${name}"`, err.message || err);
50+
}
51+
getVarianceCb(null, gasAmount);
4652
});
4753
}, (err, variance) => {
4854
if (variance.every(v => v === variance[0])) {

0 commit comments

Comments
 (0)