fix(simapp): do not repeat errors (#16865)

This commit is contained in:
Julien Robert
2023-07-07 09:22:36 +00:00
committed by GitHub
parent 7aa79058b2
commit ac6df28bef
3 changed files with 8 additions and 6 deletions
+3 -2
View File
@@ -65,8 +65,9 @@ func NewRootCmd() *cobra.Command {
WithViper("") // In simapp, we don't use any prefix for env variables.
rootCmd := &cobra.Command{
Use: "simd",
Short: "simulation app",
Use: "simd",
Short: "simulation app",
SilenceErrors: true,
PersistentPreRunE: func(cmd *cobra.Command, _ []string) error {
// set the default command outputs
cmd.SetOut(cmd.OutOrStdout())
+3 -2
View File
@@ -76,8 +76,9 @@ func NewRootCmd() *cobra.Command {
WithViper("") // In simapp, we don't use any prefix for env variables.
rootCmd := &cobra.Command{
Use: "simd",
Short: "simulation app",
Use: "simd",
Short: "simulation app",
SilenceErrors: true,
PersistentPreRunE: func(cmd *cobra.Command, _ []string) error {
// set the default command outputs
cmd.SetOut(cmd.OutOrStdout())
+2 -2
View File
@@ -1,9 +1,9 @@
package main
import (
"fmt"
"os"
"cosmossdk.io/log"
"cosmossdk.io/simapp"
"cosmossdk.io/simapp/simd/cmd"
@@ -13,7 +13,7 @@ import (
func main() {
rootCmd := cmd.NewRootCmd()
if err := svrcmd.Execute(rootCmd, "", simapp.DefaultNodeHome); err != nil {
log.NewLogger(rootCmd.OutOrStderr()).Error("failure when running app", "err", err)
fmt.Fprintln(rootCmd.OutOrStderr(), err)
os.Exit(1)
}
}