mirror of https://github.com/embarklabs/embark.git
fix error reporting for wrong params
This commit is contained in:
parent
af9e27e078
commit
66a3388a9d
|
@ -270,8 +270,8 @@ class Deploy {
|
||||||
try {
|
try {
|
||||||
deployObject = contractObject.deploy({arguments: contractParams, data: "0x" + contractCode});
|
deployObject = contractObject.deploy({arguments: contractParams, data: "0x" + contractCode});
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
if (e.indexOf('Invalid number of parameters for "undefined"') >= 0) {
|
if (e.message.indexOf('Invalid number of parameters for "undefined"') >= 0) {
|
||||||
return next(new Error("attempted to deploy " + contractObject.className + " without specifying parameters"));
|
return next(new Error("attempted to deploy " + contract.className + " without specifying parameters"));
|
||||||
} else {
|
} else {
|
||||||
return next(new Error(e));
|
return next(new Error(e));
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue