display error when there is a unknown compilation error

This commit is contained in:
Iuri Matias 2018-01-17 15:09:19 -05:00
parent ed8fe3a951
commit 80e8f6323a

View File

@ -67,6 +67,10 @@ class Solidity {
function createCompiledObject(output, callback) {
let json = output.contracts;
if (!output || !output.contracts) {
return callback(new Error("error compiling for unknown reasons"));
}
if (Object.keys(output.contracts).length === 0 && output.sourceList.length > 0) {
return callback(new Error("error compiling. There are sources available but no code could be compiled, likely due to fatal errors in the solidity code").message);
}