From 81fd2747868056e9efe7038bfd9536dae9c8fcb2 Mon Sep 17 00:00:00 2001 From: Aakil Fernandes Date: Wed, 14 Oct 2015 15:37:45 -0400 Subject: [PATCH] throw error when solc fails --- lib/compiler.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/compiler.js b/lib/compiler.js index 253bbc13..c7856639 100644 --- a/lib/compiler.js +++ b/lib/compiler.js @@ -17,6 +17,10 @@ Compiler.prototype.compile_solidity = function(contractFile) { var source = fs.readFileSync(contractFile).toString(); var output = solc.compile(source, 1); + if(output.errors && output.errors.length>0){ + throw new Error(output.errors[0]); + } + var json = output.contracts; compiled_object = {}