Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve chainId resolution and error handling (#248)
### TL;DR Improved chain ID resolution and error handling in the Tenderly Hardhat plugin. ### What changed? - Created a new `UndefinedChainIdError` class for better error messaging - Extracted chain ID resolution logic into a separate `getChainId` function - Improved error handling when chain ID cannot be determined - Standardized the chain ID resolution process across the plugin ### How to test? 1. Try verifying contracts on a network without a defined chain ID 2. Verify the new error message appears with the network name 3. Test contract verification on networks with valid chain IDs 4. Verify chain ID resolution works for both custom and predefined networks ### Why make this change? To provide clearer error messages and better handle cases where chain IDs are undefined. This improves the developer experience by making it immediately clear when and why chain ID resolution fails, rather than silently failing or providing unclear error messages.
- Loading branch information