Skip to content

Commit a50c3d1

Browse files
authored
Merge pull request #371 from dojoengine/fix/predeployed-connector
fix: catch fetch enpoint error
2 parents 7fafcc5 + ac645ac commit a50c3d1

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

.changeset/serious-readers-brush.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@dojoengine/predeployed-connector": patch
3+
---
4+
5+
Catch error when unsuccessfully fetch 'dev_predeployedAccounts' endpoint

packages/predeployed-connector/src/index.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,16 @@ import {
2121

2222
class PredeployedAccountsChannel extends RpcChannel {
2323
async getPredeployedAccounts() {
24-
// @ts-ignore
25-
return await this.fetchEndpoint("dev_predeployedAccounts");
24+
try {
25+
// @ts-ignore
26+
return await this.fetchEndpoint("dev_predeployedAccounts");
27+
} catch (error) {
28+
console.warn(
29+
"Failed to get `dev_predeployedAccounts` endpoint",
30+
error
31+
);
32+
return [];
33+
}
2634
}
2735
}
2836

0 commit comments

Comments
 (0)