From e207537d6e9ce61f1531c4bee147c90fc1524ff2 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Thu, 20 Dec 2018 13:16:33 -0500 Subject: [PATCH] fix(profiler): do not exit on error but print it --- src/lib/modules/profiler/gasEstimator.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/lib/modules/profiler/gasEstimator.js b/src/lib/modules/profiler/gasEstimator.js index 4c91ce7c9..73a589a72 100644 --- a/src/lib/modules/profiler/gasEstimator.js +++ b/src/lib/modules/profiler/gasEstimator.js @@ -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); }); @@ -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])) {