0

I have code structure like this.

try {
    await web3.eth.getTransactionReceipt(hash);
} catch (e) {
    console.log(e.message);
    console.log(e.code);
    console.log(e);
}

When the hash is 123, for example, an error is thrown. However in my browser devtools I can see that in the network response there is error code and error message. The error code appears to vanish in between. How can I get this error code?

P.S. The output of console.logs is like this:

Returned error: invalid 1st argument: transaction_hash value was not valid hexadecimal
undefined
Error: Returned error: invalid 1st argument: transaction_hash value was not valid hexadecimal
    at Object.ErrorResponse (web3.min.js:22:1)
    at eval (web3.min.js:22:1)
    at eval (web3.min.js:33:1)

0

Your Answer

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

Browse other questions tagged or ask your own question.