Skip to content

Commit 10d62a9

Browse files
authored
fix(contract_manager) Throw error on unknown chain type (#1830)
1 parent 9580252 commit 10d62a9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

contract_manager/src/store.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,11 @@ export class Store {
8686
this.getYamlFiles(`${this.path}/chains/`).forEach((yamlFile) => {
8787
const parsedArray = parse(readFileSync(yamlFile, "utf-8"));
8888
for (const parsed of parsedArray) {
89-
if (allChainClasses[parsed.type] === undefined) return;
89+
if (allChainClasses[parsed.type] === undefined) {
90+
throw new Error(
91+
`No chain class found for chain type: ${parsed.type}`
92+
);
93+
}
9094
const chain = allChainClasses[parsed.type].fromJson(parsed);
9195
if (this.chains[chain.getId()])
9296
throw new Error(`Multiple chains with id ${chain.getId()} found`);

0 commit comments

Comments
 (0)