diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-03-09 22:30:02 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-03-12 10:37:28 +0800 |
commit | c7d340e82222e090b275085cea3fffd30c7fe954 (patch) | |
tree | a5a91a931f2f5947bd6c4e3f851f312ad65616e5 /packages/deployer/src/compiler.ts | |
parent | 2c501d23807c5f446132fd8c984a16ad1069ebb3 (diff) | |
download | dexon-0x-contracts-c7d340e82222e090b275085cea3fffd30c7fe954.tar dexon-0x-contracts-c7d340e82222e090b275085cea3fffd30c7fe954.tar.gz dexon-0x-contracts-c7d340e82222e090b275085cea3fffd30c7fe954.tar.bz2 dexon-0x-contracts-c7d340e82222e090b275085cea3fffd30c7fe954.tar.lz dexon-0x-contracts-c7d340e82222e090b275085cea3fffd30c7fe954.tar.xz dexon-0x-contracts-c7d340e82222e090b275085cea3fffd30c7fe954.tar.zst dexon-0x-contracts-c7d340e82222e090b275085cea3fffd30c7fe954.zip |
Handle an error while loading the compiler
Diffstat (limited to 'packages/deployer/src/compiler.ts')
-rw-r--r-- | packages/deployer/src/compiler.ts | 3 |
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); } |