Capture & return data.ToJSON error

This commit is contained in:
Christopher Goes 2018-03-27 22:13:05 +02:00
parent 4371667673
commit fef3e157c0
1 changed files with 4 additions and 1 deletions

View File

@ -31,7 +31,10 @@ func (s showValidator) run(cmd *cobra.Command, args []string) error {
return err
}
privValidator := types.LoadOrGenPrivValidatorFS(cfg.PrivValidatorFile())
pubKeyJSONBytes, _ := data.ToJSON(privValidator.PubKey)
pubKeyJSONBytes, err := data.ToJSON(privValidator.PubKey)
if err != nil {
return err
}
fmt.Println(string(pubKeyJSONBytes))
return nil
}