aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sol-compiler/src/utils/compiler.ts
diff options
context:
space:
mode:
authorJacob Evans <jacob@dekz.net>2018-07-06 13:00:09 +0800
committerJacob Evans <jacob@dekz.net>2018-07-06 13:30:07 +0800
commit0557d6a9bfc07b8d360970ffbcf582f8a26943cb (patch)
tree76b233a7a50c2e10ee3eb09a848c2494d0512c26 /packages/sol-compiler/src/utils/compiler.ts
parentb9b00e10d39c3c84bc72892ef37f1313e904414d (diff)
downloaddexon-0x-contracts-0557d6a9bfc07b8d360970ffbcf582f8a26943cb.tar
dexon-0x-contracts-0557d6a9bfc07b8d360970ffbcf582f8a26943cb.tar.gz
dexon-0x-contracts-0557d6a9bfc07b8d360970ffbcf582f8a26943cb.tar.bz2
dexon-0x-contracts-0557d6a9bfc07b8d360970ffbcf582f8a26943cb.tar.lz
dexon-0x-contracts-0557d6a9bfc07b8d360970ffbcf582f8a26943cb.tar.xz
dexon-0x-contracts-0557d6a9bfc07b8d360970ffbcf582f8a26943cb.tar.zst
dexon-0x-contracts-0557d6a9bfc07b8d360970ffbcf582f8a26943cb.zip
Forwarding contract (squashed commits)
Diffstat (limited to 'packages/sol-compiler/src/utils/compiler.ts')
-rw-r--r--packages/sol-compiler/src/utils/compiler.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/packages/sol-compiler/src/utils/compiler.ts b/packages/sol-compiler/src/utils/compiler.ts
index 08e2d999a..968fcc5b2 100644
--- a/packages/sol-compiler/src/utils/compiler.ts
+++ b/packages/sol-compiler/src/utils/compiler.ts
@@ -58,7 +58,8 @@ export function parseSolidityVersionRange(source: string): string {
}
/**
- * Normalizes the path found in the error message.
+ * Normalizes the path found in the error message. If it cannot be normalized
+ * the original error message is returned.
* Example: converts 'base/Token.sol:6:46: Warning: Unused local variable'
* to 'Token.sol:6:46: Warning: Unused local variable'
* This is used to prevent logging the same error multiple times.
@@ -69,7 +70,9 @@ export function getNormalizedErrMsg(errMsg: string): string {
const SOLIDITY_FILE_EXTENSION_REGEX = /(.*\.sol)/;
const errPathMatch = errMsg.match(SOLIDITY_FILE_EXTENSION_REGEX);
if (_.isNull(errPathMatch)) {
- throw new Error(`Could not find a path in error message: ${errMsg}`);
+ // This can occur if solidity outputs a general warning, e.g
+ // Warning: This is a pre-release compiler version, please do not use it in production.
+ return errMsg;
}
const errPath = errPathMatch[0];
const baseContract = path.basename(errPath);