You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: friendly error handling + faucet link on register page
- Replace [object Object] with human-friendly messages when MetaMask/Circle SDK throws plain objects
- Add extractErrorMessage() helper in wallet-context.tsx and register/page.tsx
- Add 'Get tUSDC from faucet' link under wallet bar on register page
if(lower.includes("user rejected")||lower.includes("user denied"))return"You rejected the transaction in your wallet.";
394
+
if(lower.includes("user rejected")||lower.includes("user denied")||lower.includes("user cancelled"))return"You cancelled the transaction in your wallet.";
389
395
if(lower.includes("reserved"))return"This name is reserved and cannot be registered.";
390
396
if(lower.includes("name not available")||lower.includes("namenotavailable"))return"This name is no longer available.";
391
397
if(lower.includes("commit"))return"Timing issue with commit-reveal. Please wait a moment and try again.";
@@ -394,3 +400,18 @@ function readableError(err: unknown): string {
394
400
if(lower.includes("network")||lower.includes("fetch"))return"Network error. Check your connection and try again.";
395
401
returnmsg;
396
402
}
403
+
404
+
/** Extract a human-readable string from any thrown value (plain object, Error, etc.). */
0 commit comments