Skip to content

Commit c4df3c5

Browse files
authored
Merge pull request #475 from vovikhangcdv/master
fix: unhandled invalid api key
2 parents 42aedf6 + d040f12 commit c4df3c5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

crytic_compile/platform/etherscan.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,10 @@ def compile(self, crytic_compile: "CryticCompile", **kwargs: str) -> None:
299299
LOGGER.error("Incorrect etherscan request")
300300
raise InvalidCompilation("Incorrect etherscan request " + etherscan_url)
301301

302+
if not info["message"].startswith("OK") and "Invalid API Key" in info["result"]:
303+
LOGGER.error("Invalid etherscan API Key")
304+
raise InvalidCompilation("Invalid etherscan API Key: " + etherscan_url)
305+
302306
if not info["message"].startswith("OK"):
303307
LOGGER.error("Contract has no public source code")
304308
raise InvalidCompilation("Contract has no public source code: " + etherscan_url)

0 commit comments

Comments
 (0)