Is it possible to get the error data thrown by a Custom Exception using web3 in Python?
I only get execution reverted but would like to have all the information about the error. Thanks.
Ethereum Stack Exchange is a question and answer site for users of Ethereum, the decentralized application platform and smart contract enabled blockchain. It only takes a minute to sign up.
Sign up to join this communityIs it possible for you to upload the smart contract code or its address on Etherscan, so I can test it?
web3.exceptions.ContractLogicError
always prints the custom revert string if it exists, from my experience.
developer advocate from Chainstack here.
If the transaction is executed in a block, you may get logs like this. This may help you narrow down the root cause of failure. However, this information is solely depending on the contract and may not provide enough detail for debugging purposes.
If you have the contract source code, you can deploy it in a test environment and debug it using a tool like REMIX debugger.
Another approach is to use debug API or trace API if they are available on your node. They return the execution logs for your transaction on EVM. These two APIs are available on Chainstack at a cost.
Happy coding!