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

fix: add unhandled return error handling. #782

Merged

Conversation

zemyblue
Copy link
Member

@zemyblue zemyblue commented Nov 3, 2022

Description

Add unhandled return error handling.

  • baseapp/grpcserver.go
    • grpc.SetHeader(grpcCtx, md)
  • server/start.go
    • serverCtx.Viper.BindPFlags(cmd.Flags())
  • server/util.go
    • serverCtx.Viper.BindPFlags(cmd.Flags())
    • serverCtx.Viper.BindPFlags(cmd.PersistentFlags())
  • x/auth/client/rest/query.go
    • packStdTxResponse(w, clientCtx, txRes)
  • x/bank/client/cli/tx.go
    • cmd.Flags().Set(flags.FlagFrom, args[0])
  • x/feegrant/client/cli/tx.go
    • cmd.Flags().Set(flags.FlagFrom, args[0])
  • x/foundation/keeper/member.go
    • info.SetDecisionPolicy(policy)
  • x/slashing/genesis.go
    • keeper.AddPubkey(ctx, consPk)
  • x/slashing/keeper/hooks.go
    • keeper.AddPubkey(ctx, consPk)
  • x/staking/genesis.go
    • keeper.SetValidatorByConsAddr(ctx, validator)
  • x/staking/keeper/msg_server.go
    • k.SetValidatorByConsAddr(ctx, validator)
  • x/wasm/client/cli/query.go
    • flagSet.Set(flags.FlagPageKey, string(raw))

Motivation and context

How has this been tested?

Screenshots (if appropriate):

Checklist:

  • I followed the contributing guidelines and code of conduct.
  • I have added a relevant changelog to CHANGELOG.md
  • I have added tests to cover my changes.
  • I have updated the documentation accordingly.
  • I have updated API documentation client/docs/swagger-ui/swagger.yaml

@zemyblue zemyblue self-assigned this Nov 3, 2022
@zemyblue zemyblue added the A: bug Something isn't working label Nov 3, 2022
@zemyblue zemyblue marked this pull request as draft November 3, 2022 12:38
@codecov
Copy link

codecov bot commented Nov 3, 2022

Codecov Report

Merging #782 (4fe9634) into rc9/v0.46.0 (9c041c4) will decrease coverage by 0.05%.
The diff coverage is 0.00%.

Additional details and impacted files

Impacted file tree graph

@@               Coverage Diff               @@
##           rc9/v0.46.0     #782      +/-   ##
===============================================
- Coverage        62.19%   62.13%   -0.06%     
===============================================
  Files              880      880              
  Lines            99479    99488       +9     
===============================================
- Hits             61868    61815      -53     
- Misses           33994    34065      +71     
+ Partials          3617     3608       -9     
Impacted Files Coverage Δ
baseapp/grpcserver.go 1.72% <0.00%> (-0.04%) ⬇️
x/foundation/keeper/member.go 92.62% <0.00%> (-2.38%) ⬇️
x/slashing/genesis.go 67.44% <0.00%> (-1.61%) ⬇️
x/slashing/keeper/hooks.go 73.17% <0.00%> (-6.83%) ⬇️
x/staking/genesis.go 59.23% <0.00%> (-0.88%) ⬇️
x/staking/keeper/msg_server.go 0.68% <0.00%> (-0.01%) ⬇️
x/wasm/client/cli/query.go 93.43% <0.00%> (-0.42%) ⬇️
x/collection/msgs.go 47.61% <0.00%> (-7.00%) ⬇️
x/wasm/keeper/keeper.go 86.16% <0.00%> (-0.37%) ⬇️
... and 3 more

Signed-off-by: zemyblue <zemyblue@gmail.com>
@zemyblue zemyblue marked this pull request as ready for review November 3, 2022 14:36
Copy link
Collaborator

@0Tech 0Tech left a comment

Choose a reason for hiding this comment

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

LGTM

x/foundation/keeper/member.go Outdated Show resolved Hide resolved
Signed-off-by: zemyblue <zemyblue@gmail.com>
Signed-off-by: zemyblue <zemyblue@gmail.com>
@zemyblue zemyblue requested a review from 0Tech November 7, 2022 06:54
Copy link
Collaborator

@0Tech 0Tech left a comment

Choose a reason for hiding this comment

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

;)

CHANGELOG.md Show resolved Hide resolved
Co-authored-by: Youngtaek Yoon <noreply@yoon.anonaddy.me>
@zemyblue
Copy link
Member Author

zemyblue commented Nov 8, 2022

In this PR, most error handling codes can't do unittest. So I'll skip the codecov error of ci in this case.

@zemyblue zemyblue merged commit b845d33 into Finschia:rc9/v0.46.0 Nov 8, 2022
This was referenced Nov 22, 2022
@zemyblue zemyblue deleted the zemyblue/handle_return_errors branch November 29, 2022 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants