This document outlines the comprehensive error handling mechanisms implemented in the PropChain multi-chain wallet system.
The system implements four layers of error suppression to completely eliminate browser extension errors:
- Early Suppression - Activated immediately when the app loads (in layout.tsx)
- Console Override - Overrides console methods to filter extension errors
- Global Error Handlers - Catches unhandled errors and promise rejections
- Manual Suppression - User-activated error clearing
The system automatically detects and handles browser extension errors that commonly occur with Web3 wallets:
- MetaMask Extension Errors: Automatically filtered and sanitized
- Coinbase Wallet Extension Errors: Handled gracefully
- Extension Conflicts: Detected when multiple Web3 extensions are installed
- Specific Extension ID:
bfnaelmomeimhlpmgjnjophhpkkoljpa(EVM Ask extension)
-
Wallet Connection Errors
- User rejection (code 4001)
- Unauthorized access (code 4100)
- Unsupported methods (code 4200)
- Disconnected wallet (code 4900)
-
Network Switching Errors
- Chain disconnected (code 4901)
- Chain not added (code 4902)
- Unsupported networks
-
Extension-Specific Errors
- Chrome extension conflicts
- EVM provider errors (
evmAsk.js) - Extension communication failures
selectExtensionerrors
Cause: EVM Ask browser extension conflict Solution:
- ✅ Automatically suppressed by the system
- If still visible: Type
suppressErrors()in browser console - Refresh the page
- Disable the EVM Ask extension if not needed
Manual Fix:
// In browser console
suppressErrors()This will clear the console and re-activate suppression.
Cause: MetaMask extension not installed or disabled Solution:
- Install MetaMask from metamask.io
- Ensure the extension is enabled
- Refresh the page after installation
Cause: Network not added to wallet or RPC issues Solution:
- The system will automatically try to add the network
- Approve the network addition in your wallet
- Check your internet connection
Cause: Wallet disconnected or extension issues Solution:
- The system automatically attempts reconnection
- Manually reconnect if needed
- Check wallet extension status
To enable detailed error logging:
// In browser console
localStorage.setItem('propchain-debug', 'true');To disable debug mode:
localStorage.removeItem('propchain-debug');- Use MetaMask Mobile app's built-in browser
- Ensure wallet app is updated
- Check mobile browser compatibility
- Some extensions may not work
- Use MetaMask app browser for best experience
- Full extension support available
- Ensure wallet app is linked
| Code | Description | Solution |
|---|---|---|
| 4001 | User rejected request | Try again with user approval |
| 4100 | Unauthorized access | Check wallet permissions |
| 4200 | Unsupported method | Update wallet extension |
| 4900 | Wallet disconnected | Reconnect wallet |
| 4901 | Chain disconnected | Switch to supported network |
| 4902 | Chain not added | Add network to wallet |
The system includes comprehensive automatic recovery mechanisms:
- Early Error Suppression: Filters errors before React loads
- Console Method Override: Intercepts all console output
- Global Error Handlers: Catches unhandled errors and rejections
- Extension-Specific Filtering: Targets specific extension IDs
- Connection Persistence: Wallet connections survive page refreshes
- Network Validation: Automatically validates and adds supported networks
- Error Boundaries: Catches and displays user-friendly error messages
import "@/utils/earlyErrorSuppression";- Activates immediately when app loads
- Overrides console methods before React initializes
setupConsoleOverride();- Comprehensive console method overriding
- Filters extension-specific error patterns
globalErrorSuppressor();- Catches unhandled errors and promise rejections
- Prevents extension errors from bubbling up
ManualErrorSuppressor();- User-activated error clearing
- Tab visibility change detection
If you encounter persistent issues:
- Quick Fix: Type
suppressErrors()in browser console - Check browser console for detailed errors
- Ensure all extensions are updated
- Try disabling other Web3 extensions
- Clear browser cache and cookies
- Try a different browser
To test error handling:
- Try connecting with multiple wallet extensions installed
- Reject connection requests to see error handling
- Switch between different networks
- Disconnect and reconnect wallet
- Refresh page while connected
- Type
suppressErrors()in console to test manual suppression
If extension errors still appear:
// Clear console and re-activate suppression
suppressErrors()
// Or manually clear and reset
console.clear()
setupConsoleOverride()The system is designed to be bulletproof against extension errors while maintaining full functionality for legitimate wallet operations.
Summary Only a few components have Storybook stories. Add stories for all components.
Acceptance Criteria Story for every component variant Interactive controls for all props Accessibility addon checks passing Visual regression tests via Chromatic