Closed sfl0r3nz05 closed 3 years ago
You'll want to use debug_traceTransaction
for that (see https://geth.ethereum.org/docs/rpc/ns-debug#example-2). Note: ganache doesn't support the tracer
option.
The o:
looks to be an issue with webpack minifying the name of the class (RuntimeError
, I think) into the single letter, o
. Calling toString() on an Error object causes the name
of the error object to be prepended to the error's message, e.g., new Error("message").toString() === "Error: message"
.
Let me know if this answers your questions!
Thanks, @davidmurdoch, debug_tracerTransaction is exactly what I would need.
One option could be, collect ganache logs, and once I have recovered the hash of the failed transaction, via web3 catch error, recover values which normally, "debug.traceTransaction" would return. Does this make sense to you? Any idea to collect these logs? I am thinking, in something similar to this, i.e., definition of a place to collect transactions (e.g.: ganache_data).
Thanks in advance.
Why can't you just use debug_traceTransaction
?
@davidmurdoch, I didn't understand what you meant by the tracer
option. I see it now. Thank you very much.
I am running ganache on docker and I need to retrieve transaction errors via web3 and opcode logs in order to perform handling errors.
Context
This is the segment of my docker-compose used to deploy ganache: As you can see, I am using (--debug) to see the opcodes generated. In this regards, when I forcing an "out of gas" transaction, I can see this information: In addition, I retrieve this error through the web3, where I guess the name: "o", means " out of gas".
I would need, to access the information I have debugged through the API or web3.
I would appreciate any ideas.
Your Environment