Add Hardhat-style messages to errors #2862
Labels
enhancement
New feature or improvement.
fixed/complete
This Bug is fixed or Enhancement is complete and published.
Describe the Feature
There are several matcher libraries supported by hardhat which rely on string matching, which is lost during error handling in ethers.
Adding the necessary strings to error messages for CALL_EXCEPTION errors will enable those libraries to work.
For
Error(string) = "foobar"
: VM Exception while processing transaction: reverted with reason string 'foobar'For no error bytes: Transaction reverted without a reason string
For
Panic(uint256) = 1
: VM Exception while processing transaction: reverted with panic code 0x1 (Assertion error). There are other 8 panic codes we support though.Code Example
No response
The text was updated successfully, but these errors were encountered: