Skip to content

Commit

Permalink
fix: avoid undandled promise rejection
Browse files Browse the repository at this point in the history
  • Loading branch information
alexruzenhack committed Oct 20, 2023
1 parent 899e06c commit 19fb9a5
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/sagas/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,12 @@ export async function getRegisteredTokens(wallet, excludeHTR = false) {

export async function getFullnodeNetwork() {
try {
const versionData = await new Promise((resolve) => {
hathorLib.versionApi.getVersion(resolve);
});

return versionData.network;
const response = await new Promise((resolve, reject) => {
hathorLib.versionApi.getVersion(resolve).catch((error) => {
reject(error);
});
})
return response.network;
} catch {
throw new Error('Error getting fullnode version data.');
}
Expand Down

0 comments on commit 19fb9a5

Please sign in to comment.