aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-03-09 22:30:02 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2018-03-12 10:37:28 +0800
commitc7d340e82222e090b275085cea3fffd30c7fe954 (patch)
treea5a91a931f2f5947bd6c4e3f851f312ad65616e5 /packages
parent2c501d23807c5f446132fd8c984a16ad1069ebb3 (diff)
downloaddexon-sol-tools-c7d340e82222e090b275085cea3fffd30c7fe954.tar.gz
dexon-sol-tools-c7d340e82222e090b275085cea3fffd30c7fe954.tar.zst
dexon-sol-tools-c7d340e82222e090b275085cea3fffd30c7fe954.zip
Handle an error while loading the compiler
Diffstat (limited to 'packages')
-rw-r--r--packages/deployer/src/compiler.ts3
1 files changed, 3 insertions, 0 deletions
diff --git a/packages/deployer/src/compiler.ts b/packages/deployer/src/compiler.ts
index 81d01b895..b7919e254 100644
--- a/packages/deployer/src/compiler.ts
+++ b/packages/deployer/src/compiler.ts
@@ -198,6 +198,9 @@ export class Compiler {
utils.consoleLog(`Downloading ${fullSolcVersion}...`);
const url = `https://ethereum.github.io/solc-bin/bin/${fullSolcVersion}`;
const response = await fetch(url);
+ if (response.status !== 200) {
+ throw new Error(`Failed to load ${fullSolcVersion}`);
+ }
solcjs = await response.text();
fs.writeFileSync(compilerBinFilename, solcjs);
}