Skip to content

Commit

Permalink
fix(simapp): do not repeat errors (backport #16865) (#16872)
Browse files Browse the repository at this point in the history
Co-authored-by: Julien Robert <julien@rbrt.fr>
  • Loading branch information
mergify[bot] and julienrbrt committed Jul 7, 2023
1 parent d6780c1 commit e141d8e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
5 changes: 3 additions & 2 deletions simapp/simd/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
5 changes: 3 additions & 2 deletions simapp/simd/cmd/root_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
4 changes: 2 additions & 2 deletions simapp/simd/main.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package main

import (
"fmt"
"os"

"cosmossdk.io/log"
"cosmossdk.io/simapp"
"cosmossdk.io/simapp/simd/cmd"

Expand All @@ -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)
}
}

0 comments on commit e141d8e

Please sign in to comment.