ibc-go
ibc-go copied to clipboard
Unify text format for invalid/unexpected value errors
Summary
The error message for an invalid value is formatted in slightly different ways. Take the following three as an example:
"expected %s channel, got %s " (https://github.com/cosmos/ibc-go/blob/main/modules/apps/transfer/module.go#L207)
"invalid port: %s, expected %s" (https://github.com/cosmos/ibc-go/blob/main/modules/apps/transfer/module.go#L213)
"got %s, expected %s" (https://github.com/cosmos/ibc-go/blob/main/modules/apps/transfer/module.go#L217)
The goal is to format this kind of errors in a consistent way.
The proposal is to do the following:
sdkerrors.Wrapf(
<most specific error type possible>,
"<optional text description ended by colon and space>expected %s, got %s",
<value 1>,
<value 2>
)
For Admin Use
- [ ] Not duplicate issue
- [ ] Appropriate labels applied
- [ ] Appropriate contributors tagged/assigned
Hello @crodriguezvega , I would like to do this if this is still needed. Can you assign me this issue?
Sorry for the late reply, @iricehasan. I hope you're still interested in the issue, I will assign it to you now.
Hi @crodriguezvega, I have just seen your reply. I am still interested.