ibc-go icon indicating copy to clipboard operation
ibc-go copied to clipboard

Unify text format for invalid/unexpected value errors

Open crodriguezvega opened this issue 4 years ago • 3 comments

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

crodriguezvega avatar Aug 13 '21 11:08 crodriguezvega

Hello @crodriguezvega , I would like to do this if this is still needed. Can you assign me this issue?

iricehasan avatar Feb 02 '24 02:02 iricehasan

Sorry for the late reply, @iricehasan. I hope you're still interested in the issue, I will assign it to you now.

crodriguezvega avatar Feb 12 '24 23:02 crodriguezvega

Hi @crodriguezvega, I have just seen your reply. I am still interested.

iricehasan avatar Feb 19 '24 00:02 iricehasan