mirror of https://github.com/embarklabs/embark.git
fix(@embark/solidity): show a better error message in debug
This commit is contained in:
parent
7652e1d75c
commit
198a5dc3f4
|
@ -581,7 +581,7 @@ class ContractsManager {
|
|||
self.compileError = true;
|
||||
self.events.emit("status", __("Compile/Build error"));
|
||||
self.events.emit("outputError", __("Error building Dapp, please check console"));
|
||||
self.logger.error(__("Error Compiling/Building contracts: ") + err);
|
||||
self.logger.error(__("Error Compiling/Building contracts"));
|
||||
} else {
|
||||
self.compileError = false;
|
||||
}
|
||||
|
|
|
@ -49,15 +49,18 @@ class Solidity {
|
|||
return callback(output.errors);
|
||||
}
|
||||
|
||||
let isError = false;
|
||||
if (output.errors) {
|
||||
for (let i = 0; i < output.errors.length; i++) {
|
||||
if (output.errors[i].type === 'Warning') {
|
||||
self.logger.warn(output.errors[i].formattedMessage);
|
||||
}
|
||||
if (output.errors[i].type === 'Error' || output.errors[i].severity === 'error') {
|
||||
return callback(new Error("Solidity errors: " + output.errors[i].formattedMessage).message);
|
||||
isError = true;
|
||||
}
|
||||
self.logger.warn(output.errors[i].formattedMessage);
|
||||
self.logger.debug(output.errors[i].message); // Print more error information in debug
|
||||
}
|
||||
}
|
||||
if (isError) {
|
||||
return callback(__("You have solidity errors. Fix them before moving on."));
|
||||
}
|
||||
|
||||
self.events.emit('contracts:compiled:solc', output);
|
||||
|
|
Loading…
Reference in New Issue