mirror of https://github.com/embarklabs/embark.git
fix(profiler): do not exit on error but print it
This commit is contained in:
parent
b0c226a13f
commit
e207537d6e
|
@ -33,7 +33,10 @@ class GasEstimator {
|
||||||
contractObj.methods[name]
|
contractObj.methods[name]
|
||||||
.apply(contractObj.methods[name], [])
|
.apply(contractObj.methods[name], [])
|
||||||
.estimateGas((err, gasAmount) => {
|
.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;
|
gasMap[name] = gasAmount;
|
||||||
return gasCb(null, name, abiMethod.type);
|
return gasCb(null, name, abiMethod.type);
|
||||||
});
|
});
|
||||||
|
@ -42,7 +45,10 @@ class GasEstimator {
|
||||||
async.concat(fuzzMap[name], (values, getVarianceCb) => {
|
async.concat(fuzzMap[name], (values, getVarianceCb) => {
|
||||||
contractObj.methods[name].apply(contractObj.methods[name], values)
|
contractObj.methods[name].apply(contractObj.methods[name], values)
|
||||||
.estimateGas((err, gasAmount) => {
|
.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) => {
|
}, (err, variance) => {
|
||||||
if (variance.every(v => v === variance[0])) {
|
if (variance.every(v => v === variance[0])) {
|
||||||
|
|
Loading…
Reference in New Issue