Skip to content

Commit

Permalink
improve error msgs
Browse files Browse the repository at this point in the history
  • Loading branch information
chaitanyapotti committed Jul 25, 2024
1 parent dce48f0 commit 8d7e28a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/modal/src/modalManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ export class Web3Auth extends Web3AuthNoModal implements IWeb3AuthModal {
this.initializeInAppWallet(adapterName);
}
} catch (error) {
log.error(error, "error while initializing adapter");
log.error(error, "error while initializing adapter ", adapterName);
}
});

Expand Down Expand Up @@ -371,7 +371,7 @@ export class Web3Auth extends Web3AuthNoModal implements IWeb3AuthModal {
this.loginModal.addWalletLogins(adaptersConfig, { showExternalWalletsOnly: !!options?.showExternalWalletsOnly });
return undefined;
})
.catch((error) => log.error(error, "error while initializing adapter"));
.catch((error) => log.error(error, "error while initializing adapter", adapterName));
} else if (adapter.status === ADAPTER_STATUS.READY) {
adaptersConfig[adapterName] = (this.modalConfig.adapters as Record<WALLET_ADAPTER_TYPE, ModalConfig>)[adapterName];
this.loginModal.addWalletLogins(adaptersConfig, { showExternalWalletsOnly: !!options?.showExternalWalletsOnly });
Expand Down
2 changes: 1 addition & 1 deletion packages/no-modal/src/noModal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export class Web3AuthNoModal extends SafeEventEmitter implements IWeb3Auth {
});
}

return this.walletAdapters[adapterName].init({ autoConnect: this.cachedAdapter === adapterName }).catch((e) => log.error(e));
return this.walletAdapters[adapterName].init({ autoConnect: this.cachedAdapter === adapterName }).catch((e) => log.error(e, adapterName));
});
await Promise.all(initPromises);
if (this.status === ADAPTER_STATUS.NOT_READY) {
Expand Down
1 change: 1 addition & 0 deletions packages/ui/src/loginModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ class LoginModal extends SafeEventEmitter {
});
}
});
// TODO: send adapter name in error
listener.on(ADAPTER_EVENTS.ERRORED, (error: Web3AuthError) => {
log.error("error", error, error.message);
if (error.code === 5000) {
Expand Down

0 comments on commit 8d7e28a

Please sign in to comment.