Open moul opened 1 year ago
Related with #439
Hi @moul. I wonder if this is related to a question we have. In GnoMobile, if BroadcastTxCommit, returns an error in bres.CheckTx.Error
, then it wraps a meaningful error type such as std.OutOfGasError
. (Because the error is generated by the local checks before broadcasting?) We can check the error type. But if it returns an error in bres.DeliverTx.Error
then it just wraps the generic abci.StringError
. (Because only an error string is returned from the validator?)
For example when we try to register a user without enough "send", it returns the string "payment must not be less than 200000000". In GnoMobile, we would like to return an error code, but it is not ideal to have to match an error message string. (This example is realm-specific, but even language-level errors like nil pointer are just returned as strings.) I ask this question in this issue because maybe the validator can return a meaningful error type. Are there plans for that?
I propose an hybrid approach:
Today, it returns a string representation of the pointer.
It should instead return a structure that can be processed dynamically, containing as much helpful information as possible.
The ultimate goal is to start having official typed errors that can be used by wallets and frontends to react differently, i.e., supporting "redirect errors".