Merge PR #5421: Refactor Error Handling

This commit is contained in:
Alexander Bezobchuk
2019-12-27 12:57:54 -05:00
committed by GitHub
parent 3c82b66347
commit 9a183ffbcc
170 changed files with 2317 additions and 2934 deletions
+3 -2
View File
@@ -119,8 +119,9 @@ func GetCmdEditValidator(cdc *codec.Codec) *cobra.Command {
if minSelfDelegationString != "" {
msb, ok := sdk.NewIntFromString(minSelfDelegationString)
if !ok {
return fmt.Errorf(types.ErrMinSelfDelegationInvalid(types.DefaultCodespace).Error())
return types.ErrMinSelfDelegationInvalid
}
newMinSelfDelegation = &msb
}
@@ -378,7 +379,7 @@ func BuildCreateValidatorMsg(cliCtx context.CLIContext, txBldr auth.TxBuilder) (
msbStr := viper.GetString(FlagMinSelfDelegation)
minSelfDelegation, ok := sdk.NewIntFromString(msbStr)
if !ok {
return txBldr, nil, fmt.Errorf(types.ErrMinSelfDelegationInvalid(types.DefaultCodespace).Error())
return txBldr, nil, types.ErrMinSelfDelegationInvalid
}
msg := types.NewMsgCreateValidator(