fix(compiler): display errors that before were not showing
This commit is contained in:
parent
be406860d3
commit
9052c64249
|
@ -105,12 +105,32 @@ function compileSolc(embark, contractFiles, cb) {
|
|||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
let json;
|
||||
try {
|
||||
json = JSON.parse(compileString);
|
||||
} catch (e) {
|
||||
logger.error(e.message || e);
|
||||
return callback(`Compiling ${file} returned an unreadable result`);
|
||||
}
|
||||
const contracts = json.contracts;
|
||||
|
||||
let json = JSON.parse(compileString).contracts;
|
||||
if (json.errors) {
|
||||
let isError = false;
|
||||
json.errors.forEach(error => {
|
||||
if (error.severity === 'error') {
|
||||
isError = true;
|
||||
logger.error(error.formattedMessage);
|
||||
}
|
||||
|
||||
for (let contractFile in json) {
|
||||
for (let contractName in json[contractFile]) {
|
||||
let contract = json[contractFile][contractName];
|
||||
});
|
||||
if (isError) {
|
||||
return callback(`Error while compiling ${file}`);
|
||||
}
|
||||
}
|
||||
|
||||
for (let contractFile in contracts) {
|
||||
for (let contractName in contracts[contractFile]) {
|
||||
let contract = contracts[contractFile][contractName];
|
||||
|
||||
const className = contractName;
|
||||
const filename = contractFile;
|
||||
|
|
Loading…
Reference in New Issue