Skip to content

Commit

Permalink
fix: catch fetch enpoint error
Browse files Browse the repository at this point in the history
  • Loading branch information
MartianGreed committed Jan 13, 2025
1 parent 7fafcc5 commit ac645ac
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/serious-readers-brush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@dojoengine/predeployed-connector": patch
---

Catch error when unsuccessfully fetch 'dev_predeployedAccounts' endpoint
12 changes: 10 additions & 2 deletions packages/predeployed-connector/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,16 @@ import {

class PredeployedAccountsChannel extends RpcChannel {
async getPredeployedAccounts() {
// @ts-ignore
return await this.fetchEndpoint("dev_predeployedAccounts");
try {
// @ts-ignore
return await this.fetchEndpoint("dev_predeployedAccounts");
} catch (error) {
console.warn(
"Failed to get `dev_predeployedAccounts` endpoint",
error
);
return [];
}
}
}

Expand Down

0 comments on commit ac645ac

Please sign in to comment.