Skip to content
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

updated error calls with module names #2399

Conversation

alizahidraja
Copy link
Contributor

@alizahidraja alizahidraja commented Sep 27, 2022

Description

Included Module names in channel callback errors

closes: #1728


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests (does not apply)
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/) (does not apply)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

@alizahidraja
Copy link
Contributor Author

Will update the code to fix for issue raised by @colin-axner

Thanks @alizahidraja! Unfortunately with middleware, these error messages can be misleading. If we have a middleware stack which is ICS29 and ICS20, if ICS20 returns an error in the application callback, the final error message will actually indicate that the module which failed was fee-middleware (which is incorrect).

I think it might make more sense to include the portID? We could also change the notion of the "module" variable to be a "middleware stack", though it'd be nice to think this approach out fully

@alizahidraja
Copy link
Contributor Author

I have mentioned both the portID & channelID in channel callback errors for better identification, lmk if that works

Copy link
Contributor

@colin-axner colin-axner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @alizahidraja for following up on my suggestion. I think this should help make the error message a bit more useful. Just left a minor suggestion on the error string formatting, but I don't have a strong preference here

modules/core/keeper/msg_server.go Outdated Show resolved Hide resolved
Copy link
Member

@damiannolan damiannolan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @alizahidraja! LGTM 🚀

CHANGELOG.md Outdated Show resolved Hide resolved
Co-authored-by: Damian Nolan <[email protected]>
Copy link
Contributor

@chatton chatton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@mergify mergify bot merged commit 363970e into cosmos:main Sep 29, 2022
mergify bot pushed a commit that referenced this pull request Sep 29, 2022
## Description

Included Module names in channel callback errors

closes: #1728

---

Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

- [x] Targeted PR against correct branch (see [CONTRIBUTING.md](https://github.com/cosmos/ibc-go/blob/master/CONTRIBUTING.md#pr-targeting))
- [x] Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
- [x] Code follows the [module structure standards](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules/structure.md).
- [ ] Wrote unit and integration [tests](https://github.com/cosmos/ibc-go/blob/master/CONTRIBUTING.md#testing) (does not apply)
- [ ] Updated relevant documentation (`docs/`) or specification (`x/<module>/spec/`) (does not apply)
- [x] Added relevant `godoc` [comments](https://blog.golang.org/godoc-documenting-go-code).
- [x] Added a relevant changelog entry to the `Unreleased` section in `CHANGELOG.md`
- [x] Re-reviewed `Files changed` in the Github PR explorer
- [ ] Review `Codecov Report` in the comment section below once CI passes

(cherry picked from commit 363970e)
damiannolan pushed a commit that referenced this pull request Sep 29, 2022
## Description

Included Module names in channel callback errors

closes: #1728

---

Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

- [x] Targeted PR against correct branch (see [CONTRIBUTING.md](https://github.com/cosmos/ibc-go/blob/master/CONTRIBUTING.md#pr-targeting))
- [x] Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
- [x] Code follows the [module structure standards](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules/structure.md).
- [ ] Wrote unit and integration [tests](https://github.com/cosmos/ibc-go/blob/master/CONTRIBUTING.md#testing) (does not apply)
- [ ] Updated relevant documentation (`docs/`) or specification (`x/<module>/spec/`) (does not apply)
- [x] Added relevant `godoc` [comments](https://blog.golang.org/godoc-documenting-go-code).
- [x] Added a relevant changelog entry to the `Unreleased` section in `CHANGELOG.md`
- [x] Re-reviewed `Files changed` in the Github PR explorer
- [ ] Review `Codecov Report` in the comment section below once CI passes

(cherry picked from commit 363970e)

Co-authored-by: Ali Zahid Raja <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Include Module name in channel callback errors
5 participants