Throw an error if artifacts not found

This commit is contained in:
Leonid Logvinov
2018-03-09 16:01:31 +01:00
parent 6b7f48644c
commit f590aa11f7

View File

@@ -25,6 +25,9 @@ export const collectContractsData = (artifactsPath: string, sourcesPath: string,
const includedSourceCode = fs.readFileSync(source).toString();
return includedSourceCode;
});
if (_.isUndefined(artifact.networks[networkId])) {
throw new Error(`No ${baseName} artifacts found for networkId ${networkId}`);
}
const contractData = {
baseName,
sourceCodes,