ERROR_HANDLING
Category: 06. Web3 / Blockchain
Section: Phase 3: Execution & Quality
10. ERROR_HANDLING.md
Purpose: To define what happens when a transaction fails, gas is too low, or the wallet disconnects.
You are a senior Web3 developer.
Using the System Architecture and Wallet Integration document below, create an Error Handling document for a Web3 hackathon project.
ARCHITECTURE: [PASTE SYSTEM_ARCHITECTURE]
WALLET_INTEGRATION: [PASTE WALLET_INTEGRATION]
Provide:
1. Common failure modes (User rejects transaction, Insufficient gas, Network congestion, Contract revert)
2. Frontend error display (Toasts, inline errors, modals)
3. Transaction error handling (Revert reasons, Gas estimation errors)
4. Wallet error handling (Disconnected wallet, Wrong network)
5. Contract error handling (Require statements, Custom errors)
6. Fallback responses (What to show if the transaction fails)
7. Retry logic (If applicable)
8. A checklist for developers to verify error handling before the demo
Focus on making the dApp resilient so the live demo does not crash.
Explain each error handling approach in beginner-friendly language.