-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better error loggin when a message execution fails #60
Comments
Hi @Kayanski, There is a chain of errors returned, that can be simply printed in debug, e.g.:
and produces full error report with the initial place where the error occured, similar to following:
You can check it in the App test, here: Let me know if it addresses your needs :-) |
Hello, thanks for the quick reply ! Actually, what I am doing in my contract is returning the error that gets sent in a reply as text to an acknowlegment function (for IBC purposes) so what's returned is only the error Display text and not Debug, and I don't have access to that error. Because it's IBC obviously the function should not error. For now, I'm just commenting out the lines I quoted above for my needs, but as per your answer, I don't see a way of handling that better for now. |
Ok, so if the Display for such an error would contain the report I mentioned previously, then it would be then satisfactory for you? |
Yes that would be very good for my purposes ! Thank you. IBC is always complicated to handle, let's make it simple 🦾 |
Just to make it clearer for me, could you provide only the code snippet where you get the error and you convert it to text to place it in reply message, please? |
Hello @Kayanski! Could you run your tests using Multi Test from the branch better-error-logging, just to verify if it reports your errors more precisely? Thanks in advance. |
Hello ! This is perfect ! I now have something like this, which is expected and simpler to debug : {"fatal_error":"Error executing WasmMsg:\n sender: contract9\n Execute { contract_addr: \"contract9\", msg: {\"rx\":{\"connection_id\":\"connection-0\",\"counterparty_port\":\"wasm.contract8\",\"data\":\"eyJzZW5kZXIiOiJjb250cmFjdDQiLCJtc2ciOnsiZXhlY3V0ZSI6eyJtc2dzIjpbXX19fQ==\"}}, funds: [] }\n\nCaused by:\n Generic error: Invalid input: canonical address length not correct"} Thank you for this fix ! |
The 3 lines here : https://github.com/CosmWasm/cw-multi-test/blob/main/src/wasm.rs#L210-L213, prevent error messages to propagate properly (especially for nested execution and replies to error messages).
This makes it really difficult to find out what the error message is.
I understand that this mimic Contract execution and obscure error messages, but for dev purposes, is it possible to propagate errors without obfuscating them ?
Thank you for your concern :)
The text was updated successfully, but these errors were encountered: