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

Co-authored-by: Julien Robert <julien@rbrt.fr>
This commit is contained in:
mergify[bot]
2023-07-07 11:58:13 +02:00
committed by GitHub
co-authored by Julien Robert
parent d6780c1094
commit e141d8e106
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)
}
}