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
parent d6780c1094
commit e141d8e106
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 6 deletions

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())

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())

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)
}
}