0

When sending transactions using ethers.js to the Hedera testnet, and one errors, I can catch it like so:

    } catch (error) {
        if (error instanceof Error) console.log(error.message);
        else console.log(error);
    }

And the output looks like this:

[Request ID: ed2b0630-b17d-4e64-82e8-f7aea3196f82] Unknown error invoking RPC

The text Unknown error invoking RPC is not particularly useful here, however, I can use ed2b0630-b17d-4e64-82e8-f7aea3196f82 is useful when contacting support, as that enables detailed retrieval of the error logs.

However, in cases of intermittently errors, where the same transaction results in an error sometimes, and other times it succeeds, I have been asked to provide the request ID of the one that succeeded. However I'm not sure how to do this using ethers.js. I suspect it needs extraction of low level RPC responses, but not sure if this is possible from ethersjs, and if so how?

bguiz
  • 27,371
  • 47
  • 154
  • 243
  • In [a (now deleted) answer](https://stackoverflow.com/a/76051291/194982) below, there was some helpful feedback: "I strongly recommend that you run your own local JSON RPC Relay if you want to have access to the logs." ... and it indicated that it is not possible to extract the Request ID from a successful RPC request. My own inspection of the RPC response showed that the Request ID was not present anywhere in the response received by ethers.js... therefore my interrim conclusion is that what I'm asking is **not possible** to do. – bguiz Apr 28 '23 at 02:29

0 Answers0