Skip to content

Commit

Permalink
fix(profiler): do not exit on error but print it
Browse files Browse the repository at this point in the history
  • Loading branch information
jrainville authored and iurimatias committed Dec 20, 2018
1 parent b0c226a commit e207537
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/lib/modules/profiler/gasEstimator.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ class GasEstimator {
contractObj.methods[name]
.apply(contractObj.methods[name], [])
.estimateGas((err, gasAmount) => {
if (err) return gasCb(err, name, abiMethod.type);
if (err) {
self.logger.error(`Error getting gas estimate for "${name}"`, err.message || err);
return gasCb(null, name, abiMethod.type);
}
gasMap[name] = gasAmount;
return gasCb(null, name, abiMethod.type);
});
Expand All @@ -42,7 +45,10 @@ class GasEstimator {
async.concat(fuzzMap[name], (values, getVarianceCb) => {
contractObj.methods[name].apply(contractObj.methods[name], values)
.estimateGas((err, gasAmount) => {
getVarianceCb(err, gasAmount);
if (err) {
self.logger.error(`Error getting gas estimate for "${name}"`, err.message || err);
}
getVarianceCb(null, gasAmount);
});
}, (err, variance) => {
if (variance.every(v => v === variance[0])) {
Expand Down

0 comments on commit e207537

Please sign in to comment.