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

Missing Error Check on RegisterGRPCGatewayRoutes() #713

Closed
3 of 4 tasks
tkxkd0159 opened this issue Oct 14, 2022 · 0 comments · Fixed by #722
Closed
3 of 4 tasks

Missing Error Check on RegisterGRPCGatewayRoutes() #713

tkxkd0159 opened this issue Oct 14, 2022 · 0 comments · Fixed by #722
Assignees

Comments

@tkxkd0159
Copy link
Member

tkxkd0159 commented Oct 14, 2022

Summary

Missing Error Check on RegisterGRPCGatewayRoutes()

Problem Definition

The function RegisterGRPCGatewayRoutes() is used to register GRPC gateway routers for the aforementioned modules.

func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) {
	types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx))
}

The function has a return value as an error type, however, the error returned here type.RegisterQueryHandlerClient() is not properly handled.

Proposal

Recommend properly handling the error.

func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) {
	if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)); err != nil {
		// error handling logic here
	}
}

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant