fix(smart-wallet): Improve error message for connection failures (#4343)
## Problem solved
Short description of the bug fixed or feature added
<!-- start pr-codex -->
---
## PR-Codex overview
This PR improves error handling in smart wallet connection by providing a more informative error message when encountering an RPC error.
### Detailed summary
- Improved error message when smart wallet connection fails due to RPC error
- Added dynamic error message including original error message or "unknown error"
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"thirdweb": patch
|
||||
---
|
||||
|
||||
Better error message when smart wallet connection fails due to rpc error
|
||||
@@ -133,7 +133,7 @@ export async function connectSmartWallet(
|
||||
.then((address) => address)
|
||||
.catch((err) => {
|
||||
throw new Error(
|
||||
`Failed to get account address with factory contract ${factoryContract.address} on chain ID ${chain.id}. Are you on the right chain?`,
|
||||
`Failed to get account address with factory contract ${factoryContract.address} on chain ID ${chain.id}: ${err?.message || "unknown error"}`,
|
||||
{ cause: err },
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user