mirror of https://github.com/embarklabs/embark.git
fix(deployment): add a message when the errror is about the input
This commit is contained in:
parent
21dff441d1
commit
7a5035ec49
|
@ -41,7 +41,9 @@
|
|||
"testnet": 3,
|
||||
"ropsten": 3,
|
||||
"rinkeby": 4
|
||||
}
|
||||
},
|
||||
"gasAllowanceError": "Returned error: gas required exceeds allowance or always failing transaction",
|
||||
"gasAllowanceErrorMessage": "Failing call, this could be because of invalid inputs or function guards that may have been triggered, or an unknown error."
|
||||
},
|
||||
"storage": {
|
||||
"init": "init",
|
||||
|
@ -62,4 +64,4 @@
|
|||
"explicit": "explicit"
|
||||
},
|
||||
"embarkResourceOrigin": "http://embark"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -124,8 +124,8 @@ class ContractsManager {
|
|||
res.send({result});
|
||||
});
|
||||
} catch (e) {
|
||||
if (funcCall === 'call' && e.message === 'Returned error: gas required exceeds allowance or always failing transaction') {
|
||||
return res.send({result: 'Failing call, this could be because of invalid inputs or function guards that may have been triggered, or an unknown error.'});
|
||||
if (funcCall === 'call' && e.message === constants.blockchain.gasAllowanceError) {
|
||||
return res.send({result: constants.blockchain.gasAllowanceErrorMessage});
|
||||
}
|
||||
res.send({result: e.message});
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ let async = require('async');
|
|||
|
||||
const ContractDeployer = require('./contract_deployer.js');
|
||||
const cloneDeep = require('clone-deep');
|
||||
const constants = require('../../constants');
|
||||
|
||||
class DeployManager {
|
||||
constructor(embark, options) {
|
||||
|
@ -66,6 +67,9 @@ class DeployManager {
|
|||
if (err) {
|
||||
contract.error = err.message || err;
|
||||
self.logger.error(`[${contract.className}]: ${err.message || err}`);
|
||||
if (contract.error === constants.blockchain.gasAllowanceError) {
|
||||
self.logger.error(constants.blockchain.gasAllowanceErrorMessage);
|
||||
}
|
||||
errors.push(err);
|
||||
}
|
||||
callback();
|
||||
|
|
Loading…
Reference in New Issue