Capture & return data.ToJSON error

This commit is contained in:
Christopher Goes
2018-03-28 11:41:55 +02:00
parent 4371667673
commit fef3e157c0
+4 -1
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
}