This means that a parent contract only has codespace/code as information to guess what happened and notify the user, which ends up leaving the user in the dark about what actually made their message fail.
A simple solution is to keep track of any errors generated in submessages and emit them as events. This leaves the interaction between contracts unaffected while surfacing the errors to the users (and contract devs in the process of debugging).
Since https://github.com/CosmWasm/wasmd/issues/759, any errors from submessages are redacted to avoid issues with non-determinism.
This means that a parent contract only has codespace/code as information to guess what happened and notify the user, which ends up leaving the user in the dark about what actually made their message fail.
A simple solution is to keep track of any errors generated in submessages and emit them as events. This leaves the interaction between contracts unaffected while surfacing the errors to the users (and contract devs in the process of debugging).
This can easily be implemented here: https://github.com/CosmWasm/wasmd/blob/main/x/wasm/keeper/msg_dispatcher.go#L150-L152 (or inside
redactError
if we pass the context)