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.log
s 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)