Foundry/Anvil Error Handling #3802
Replies: 1 comment 2 replies
-
I would love a standard for errors and is something I bring up all the time when new projects that might be able to fix it come up, but unfortunately I don’t think any of those standard steering projects receive sufficient funding, because I seldom here of them again. :( We used to have monthly calls with and RPC steering committee, but haven’t heard from them in a while either (if you are out there reading this, please chime in ;)). If there are new strings to accept, that is something I’d like to roll into ethers, as ethers attempts to coalesce errors into machine-readable and human-readable errors. Are you currently using v5 or v6? I’ve tried to simplify and be more precise the logic in v6, since string matching in the face of custom errors has added a whole new challenge. I’m going to move this to the “Ideas Discussion” and would definitely like to continue discussing. ;) |
Beta Was this translation helpful? Give feedback.
-
Describe the Feature
Hey @ricmoo 👋
Was using foundry's anvil as drop-in replacement for
hardhat node
today and realised it had issues with error parsing.Turns out ethers is doing some regex string matching
message.match(/gas required exceeds allowance.../)
on"gas required exceeds allowance:" but anvil would throw with "required gas exceeds allowance:".
It seems hardhat had some issues with this in the past as well and a lack of standards causes these problems and requires to come up with string matching patches. The current solution to rephrase the message seems to be a hotfix if anything and is not really stable or localisation friendly. So maybe it helps to discuss and have a compatible format early on to avoid problems down the road.
Here is the anvil PR: foundry-rs/foundry#4391
Code Example
No response
Beta Was this translation helpful? Give feedback.
All reactions