1

I have some transaction that is sent and from time to time when I call the eth_getTransactionReceipt I get a null.

I see esentially two approaches for handling this:

  • I could reiterate the call to eth_getTransactionReceipt in order to eventually get a non null TransactionReceipt. This approach works in some cases but will not handle the case where the transaction fails.
  • Resending the exact same transaction with eth_sendRawTransaction results in a "nonce too low" in the case where the transaction is still pending.

How could one handle those two possible scenarios (transaction not yet implemented, or transaction did not pass)?

I have two questions on the error codes:

  • I saw in some cases the "known transaction" as error instead of "nonce too low". Indeed if a transaction is resent then one would expect to get a different error than in cases of nonce too low.

  • By the way what could be the list of possible error codes? Standard references such as https://github.com/ethereum/wiki/wiki/JSON-RPC do not give the list of possible errors.

Is there a recommended way to handle error cases of transactions?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.