Skip to content

Commit b56b51c

Browse files
committed
don't stop when getting a compiler warning but print it as a warning
1 parent aa5efab commit b56b51c

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

lib/contracts/compiler.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,11 @@ class Compiler {
8383
self.logger.info("compiling contracts...");
8484
solcW.compile({sources: input}, 1, function (output) {
8585
if (output.errors) {
86-
return callback(new Error("Solidity errors: " + output.errors).message);
86+
if (output.errors.length === 1 && output.errors[0].indexOf('Warning:') >= 0) {
87+
self.logger.warn(output.errors[0]);
88+
} else {
89+
return callback(new Error("Solidity errors: " + output.errors).message);
90+
}
8791
}
8892
callback(null, output);
8993
});

test_app/app/contracts/simple_storage.sol

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ contract SimpleStorage {
1212
storedData = x;
1313
}
1414

15+
function set2(uint x, uint y) {
16+
storedData = x;
17+
}
18+
1519
function get() constant returns (uint retVal) {
1620
return storedData;
1721
}

0 commit comments

Comments
 (0)