fix error reporting for wrong params

This commit is contained in:
Iuri Matias 2018-03-02 17:48:30 -05:00
parent af9e27e078
commit 66a3388a9d
2 changed files with 16 additions and 2 deletions

View File

@ -270,8 +270,8 @@ class Deploy {
try {
deployObject = contractObject.deploy({arguments: contractParams, data: "0x" + contractCode});
} catch(e) {
if (e.indexOf('Invalid number of parameters for "undefined"') >= 0) {
return next(new Error("attempted to deploy " + contractObject.className + " without specifying parameters"));
if (e.message.indexOf('Invalid number of parameters for "undefined"') >= 0) {
return next(new Error("attempted to deploy " + contract.className + " without specifying parameters"));
} else {
return next(new Error(e));
}

View File

@ -0,0 +1,14 @@
contract SomeContract {
address public addr_1;
address public addr_2;
uint public value;
function() public payable { }
function SomeContract(address _addresses, uint initialValue) public {
//addr_1 = _addresses[0];
//addr_2 = _addresses[1];
value = initialValue;
}
}