edr icon indicating copy to clipboard operation
edr copied to clipboard

Investigate how to make JSON serde errors user-friendly

Open Wodann opened this issue 2 years ago • 2 comments

Several Hardhat tests have been deactivated as we cannot match the helpful error messages in Hardhat with our current approach. The codebase contains TODOs with a link to this issue for those instances.

Definition of Done Create a plan to provide more user-friendly error messages for JSON parsing failures and create associated tasks

Wodann avatar May 18 '23 18:05 Wodann

https://www.notion.so/nomicfoundation/Meeting-hardhat-s-provider-error-expectations-9d0c44a5e18a424c8ab0b0c7a849e778

Wodann avatar Jul 20 '23 18:07 Wodann

https://github.com/NomicFoundation/hardhat/issues/6660 reported another instance that should be improved:

const { provider } = await hre.network.connect();

let blockNumber = 0;

// throws error
await provider.request({ method: 'eth_getBalance', params: ['0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266', blockNumber]});

throws with an error:

ProviderError: Method eth_getBalance is not supported

As none of the enum MethodInvocation variants matches the provided input, we overzealously assume that the method didn't exist. It would be more helpful if EDR reported invalid parameters as the reason.

Wodann avatar May 06 '25 10:05 Wodann