You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a list of Generic Error Codes in the ethers v5 document. But is there a solid way to make transaction errors returning from the contract ( including the validations returned by solidity modifiers )?
And with the current ethers v5 functionality what is the best practice for error handling?
for example, if you take a look at this error returned from Ethers when calling a contract method, is there any way to properly parse this string into an object?
Error: cannot estimate gas; transaction may fail or may require manual gas limit [ See: https://links.ethers.org/v5-errors-UNPREDICTABLE_GAS_LIMIT ] (reason="execution reverted: You don't have any reward", method="estimateGas", transaction={"from":"0xCc2edaEdebEA9c37d3aBc3912fF99b08904B1c99","to":"0x29286507623957749A2FC39Cb88393a6EdF4ADDD","data":"0xb88a802f","accessList":null}, error={"code":-32603,"message":"Internal JSON-RPC error.","data":{"code":3,"message":"execution reverted: You don't have any reward","data":"0x08c379a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000019596f7520646f6e2774206861766520616e792072657761726400000000000000","cause":null}}, code=UNPREDICTABLE_GAS_LIMIT, version=providers/5.7.2)
Code Snippet
No response
Contract ABI
No response
Errors
No response
Environment
No response
Environment (Other)
No response
The text was updated successfully, but these errors were encountered:
Ethers Version
5.7
Search Terms
typescript, ERROR, error handling
Describe the Problem
There is a list of Generic Error Codes in the ethers v5 document. But is there a solid way to make transaction errors returning from the contract ( including the validations returned by solidity modifiers )?
And with the current ethers v5 functionality what is the best practice for error handling?
for example, if you take a look at this error returned from Ethers when calling a contract method, is there any way to properly parse this string into an object?
Error: cannot estimate gas; transaction may fail or may require manual gas limit [ See: https://links.ethers.org/v5-errors-UNPREDICTABLE_GAS_LIMIT ] (reason="execution reverted: You don't have any reward", method="estimateGas", transaction={"from":"0xCc2edaEdebEA9c37d3aBc3912fF99b08904B1c99","to":"0x29286507623957749A2FC39Cb88393a6EdF4ADDD","data":"0xb88a802f","accessList":null}, error={"code":-32603,"message":"Internal JSON-RPC error.","data":{"code":3,"message":"execution reverted: You don't have any reward","data":"0x08c379a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000019596f7520646f6e2774206861766520616e792072657761726400000000000000","cause":null}}, code=UNPREDICTABLE_GAS_LIMIT, version=providers/5.7.2)
Code Snippet
No response
Contract ABI
No response
Errors
No response
Environment
No response
Environment (Other)
No response
The text was updated successfully, but these errors were encountered: