aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorF. Eugene Aumson <gene@aumson.org>2018-08-16 04:38:41 +0800
committerF. Eugene Aumson <gene@aumson.org>2018-08-16 04:38:41 +0800
commit8959b0993e92d86fdf8539d11d4e4c70185eb8ed (patch)
tree00ae2609f99ff70f85fec723baddfc32e74e58ad
parent7c96fa45f85906a9ba4d09b8aaa4759e7d55286f (diff)
downloaddexon-sol-tools-8959b0993e92d86fdf8539d11d4e4c70185eb8ed.tar
dexon-sol-tools-8959b0993e92d86fdf8539d11d4e4c70185eb8ed.tar.gz
dexon-sol-tools-8959b0993e92d86fdf8539d11d4e4c70185eb8ed.tar.bz2
dexon-sol-tools-8959b0993e92d86fdf8539d11d4e4c70185eb8ed.tar.lz
dexon-sol-tools-8959b0993e92d86fdf8539d11d4e4c70185eb8ed.tar.xz
dexon-sol-tools-8959b0993e92d86fdf8539d11d4e4c70185eb8ed.tar.zst
dexon-sol-tools-8959b0993e92d86fdf8539d11d4e4c70185eb8ed.zip
raise error for unknown compiler version
-rw-r--r--packages/sol-compiler/src/compiler.ts3
1 files changed, 3 insertions, 0 deletions
diff --git a/packages/sol-compiler/src/compiler.ts b/packages/sol-compiler/src/compiler.ts
index ff3805073..9a6dcff09 100644
--- a/packages/sol-compiler/src/compiler.ts
+++ b/packages/sol-compiler/src/compiler.ts
@@ -85,6 +85,9 @@ export class Compiler {
private static async _getSolcAsync(
solcVersion: string,
): Promise<{ solcInstance: solc.SolcInstance; fullSolcVersion: string }> {
+ if (_.isUndefined(binPaths[solcVersion])) {
+ throw new Error(`${solcVersion} is not a known compiler version`);
+ }
const fullSolcVersion = binPaths[solcVersion];
const compilerBinFilename = path.join(SOLC_BIN_DIR, fullSolcVersion);
let solcjs: string;