-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
Hello, while using Ganache as a development backend, some errors are not handled as expected.
For instance with the following one (the context is a call to ethers estimateGas method which makes a dry run of the transaction and so can throw similar errors as the actual transaction):
{
"code": -32603,
"data": {
"code": -32000,
"data": {
"hash": null,
"message": "revert",
"programCounter": 1420,
"reason": "[revert message]",
"result": "0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000c34303920436f6e666c6963740000000000000000000000000000000000000000"
},
"message": "VM Exception while processing transaction: revert [revert message]",
"name": "RuntimeError",
"stack": "RuntimeError: VM Exception while processing transaction: revert [revert message]\n at exactimate ([path]/node_modules/ganache/dist/node/1.js:2:182333)"
},
"message": "Internal JSON-RPC error."
}It is parsed as { errorCode: 'UNKNOWN_ERROR', context: '-32603' } while imho it should return the EXECUTION_REVERTED one :
ethers-error-parser/lib/constants.ts
Line 6 in d4e452b
| EXECUTION_REVERTED: "EXECUTION_REVERTED", |
The text message looks really specific to Ganache and I'm wondering whether the whole error structure is also specific to it. How could it be then handled by the error parser ?
Metadata
Metadata
Assignees
Labels
No labels