Merge pull request #101 from dummymarket/solcerror

throw error when solc fails
This commit is contained in:
Iuri Matias 2015-10-14 16:07:27 -04:00
commit fd5d94b1d9
1 changed files with 4 additions and 0 deletions

View File

@ -17,6 +17,10 @@ Compiler.prototype.compile_solidity = function(contractFile) {
var source = fs.readFileSync(contractFile).toString(); var source = fs.readFileSync(contractFile).toString();
var output = solc.compile(source, 1); var output = solc.compile(source, 1);
if(output.errors && output.errors.length>0){
throw new Error(output.errors[0]);
}
var json = output.contracts; var json = output.contracts;
compiled_object = {} compiled_object = {}