From 2d63051bf10a5e7120cbe47e95c1e7bc7cf3fc0c Mon Sep 17 00:00:00 2001 From: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Mon, 28 Mar 2022 13:36:43 -0700 Subject: [PATCH 1/3] refactor: better error message --- x/auth/middleware/msg_service_router.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/auth/middleware/msg_service_router.go b/x/auth/middleware/msg_service_router.go index 5254810da302..79aea3350c91 100644 --- a/x/auth/middleware/msg_service_router.go +++ b/x/auth/middleware/msg_service_router.go @@ -67,7 +67,7 @@ func (msr *MsgServiceRouter) RegisterService(sd *grpc.ServiceDesc, handler inter // We panic here because there is no other alternative and the app cannot be initialized correctly // this should only happen if there is a problem with code generation in which case the app won't // work correctly anyway. - panic(fmt.Errorf("can't register request type %T for service method %s", i, fqMethod)) + panic(fmt.Errorf("unable to register service method %s: %T does not implement sdk.Msg", fqMethod, i)) } requestTypeName = sdk.MsgTypeURL(msg) From 18e19e814c97a737136384d7512f2ca188fda2e7 Mon Sep 17 00:00:00 2001 From: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Mon, 28 Mar 2022 13:42:29 -0700 Subject: [PATCH 2/3] chore: changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b13f496a3eea..548f2237a394 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -194,6 +194,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/auth) [\#10880](https://github.com/cosmos/cosmos-sdk/pull/10880) Added a new query to the tx query service that returns a block with transactions fully decoded. * (types) [\#11200](https://github.com/cosmos/cosmos-sdk/pull/11200) Added `Min()` and `Max()` operations on sdk.Coins. * (gov) [\#11287](https://github.com/cosmos/cosmos-sdk/pull/11287) Fix error message when no flags are provided while executing `submit-legacy-proposal` transaction. +* (x/auth) [\#11482](https://github.com/cosmos/cosmos-sdk/pull/11482) Improve error message when attempting to register a method handler for a message that does not implement sdk.Msg ### Bug Fixes From dbe11610848f1b9b9c587ac746546c7ce4bdc170 Mon Sep 17 00:00:00 2001 From: technicallyty <48813565+tytech3@users.noreply.github.com> Date: Mon, 28 Mar 2022 13:43:17 -0700 Subject: [PATCH 3/3] chore: error -> panic --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 548f2237a394..97d659b5b8df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -194,7 +194,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/auth) [\#10880](https://github.com/cosmos/cosmos-sdk/pull/10880) Added a new query to the tx query service that returns a block with transactions fully decoded. * (types) [\#11200](https://github.com/cosmos/cosmos-sdk/pull/11200) Added `Min()` and `Max()` operations on sdk.Coins. * (gov) [\#11287](https://github.com/cosmos/cosmos-sdk/pull/11287) Fix error message when no flags are provided while executing `submit-legacy-proposal` transaction. -* (x/auth) [\#11482](https://github.com/cosmos/cosmos-sdk/pull/11482) Improve error message when attempting to register a method handler for a message that does not implement sdk.Msg +* (x/auth) [\#11482](https://github.com/cosmos/cosmos-sdk/pull/11482) Improve panic message when attempting to register a method handler for a message that does not implement sdk.Msg ### Bug Fixes