Skip to content

Commit

Permalink
display chaintypes error (#732)
Browse files Browse the repository at this point in the history
  • Loading branch information
fishmonger45 authored Jan 4, 2022
1 parent 5419a52 commit fc2d1cc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/node/src/configure/project.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
manifestIsV0_0_1,
manifestIsV0_2_0,
loadChainTypes,
ChainTypes,
} from '@subql/common';
import { SubqlDatasource } from '@subql/types';
import chalk from 'chalk';
Expand Down Expand Up @@ -120,15 +121,18 @@ export class SubqueryProject {
}

let rawChainTypes: unknown;
let parsedChainTypes: ChainTypes;
try {
rawChainTypes = loadChainTypes(
path.join(this._path, impl.network.chaintypes.file),
this.path,
);
parsedChainTypes = parseChainTypes(rawChainTypes);
} catch (e) {
logger.error(`failed to load chaintypes file, ${e}`);
logger.error(`Failed to load chaintypes file, ${e}`);
process.exit(1);
}
return parseChainTypes(rawChainTypes);
return parsedChainTypes;
}
}
}

0 comments on commit fc2d1cc

Please sign in to comment.