diff --git a/cmd/yorkie/context/list.go b/cmd/yorkie/context/list.go index c4fe1a73a..1af633701 100644 --- a/cmd/yorkie/context/list.go +++ b/cmd/yorkie/context/list.go @@ -31,7 +31,7 @@ func newListCommand() *cobra.Command { Short: "List all contexts from configuration", PreRunE: func(cmd *cobra.Command, args []string) error { if err := viper.ReadInConfig(); err != nil { - return err + return fmt.Errorf("failed to read in config: %w", err) } return nil }, diff --git a/cmd/yorkie/context/set.go b/cmd/yorkie/context/set.go index 516c37b86..77b286484 100644 --- a/cmd/yorkie/context/set.go +++ b/cmd/yorkie/context/set.go @@ -31,7 +31,7 @@ func newSetContextCmd() *cobra.Command { Short: "Set the current global flags as the context", PreRunE: func(cmd *cobra.Command, args []string) error { if err := viper.ReadInConfig(); err != nil { - return err + return fmt.Errorf("failed to read in config: %w", err) } return nil }, diff --git a/cmd/yorkie/document/list.go b/cmd/yorkie/document/list.go index 76cf94028..6415e3afb 100644 --- a/cmd/yorkie/document/list.go +++ b/cmd/yorkie/document/list.go @@ -19,6 +19,7 @@ package document import ( "context" "errors" + "fmt" "time" "github.com/jedib0t/go-pretty/v6/table" @@ -42,7 +43,7 @@ func newListCommand() *cobra.Command { Short: "List all documents in the project", PreRunE: func(cmd *cobra.Command, args []string) error { if err := viper.ReadInConfig(); err != nil { - return err + return fmt.Errorf("failed to read in config: %w", err) } return nil }, diff --git a/cmd/yorkie/document/remove.go b/cmd/yorkie/document/remove.go index 7946cc826..1d2ace454 100644 --- a/cmd/yorkie/document/remove.go +++ b/cmd/yorkie/document/remove.go @@ -19,6 +19,7 @@ package document import ( "context" "errors" + "fmt" "github.com/spf13/cobra" "github.com/spf13/viper" @@ -38,7 +39,7 @@ func newRemoveCommand() *cobra.Command { Example: "yorkie document remove sample-project sample-document [options]", PreRunE: func(cmd *cobra.Command, args []string) error { if err := viper.ReadInConfig(); err != nil { - return err + return fmt.Errorf("failed to read in config: %w", err) } return nil }, diff --git a/cmd/yorkie/history.go b/cmd/yorkie/history.go index 83ec30ea4..8d7b7d42c 100644 --- a/cmd/yorkie/history.go +++ b/cmd/yorkie/history.go @@ -19,6 +19,7 @@ package main import ( "context" "errors" + "fmt" "github.com/jedib0t/go-pretty/v6/table" "github.com/spf13/cobra" @@ -41,7 +42,7 @@ func newHistoryCmd() *cobra.Command { Short: "Show the history of a document", PreRunE: func(cmd *cobra.Command, args []string) error { if err := viper.ReadInConfig(); err != nil { - return err + return fmt.Errorf("failed to read in config: %w", err) } return nil }, diff --git a/cmd/yorkie/login.go b/cmd/yorkie/login.go index 08fd3db6e..7233ad9ef 100644 --- a/cmd/yorkie/login.go +++ b/cmd/yorkie/login.go @@ -18,6 +18,7 @@ package main import ( "context" + "fmt" "github.com/spf13/cobra" "github.com/spf13/viper" @@ -37,7 +38,7 @@ func newLoginCmd() *cobra.Command { Short: "Log in to the Yorkie server", PreRunE: func(cmd *cobra.Command, args []string) error { if err := viper.ReadInConfig(); err != nil { - return err + return fmt.Errorf("failed to read in config: %w", err) } return nil }, diff --git a/cmd/yorkie/logout.go b/cmd/yorkie/logout.go index c7f0a8d3e..a22bbc0f5 100644 --- a/cmd/yorkie/logout.go +++ b/cmd/yorkie/logout.go @@ -20,7 +20,7 @@ func newLogoutCmd() *cobra.Command { Short: "Log out from the Yorkie server", PreRunE: func(cmd *cobra.Command, args []string) error { if err := viper.ReadInConfig(); err != nil { - return err + return fmt.Errorf("failed to read in config: %w", err) } return nil }, diff --git a/cmd/yorkie/project/create.go b/cmd/yorkie/project/create.go index 81a08a0cd..f761ca725 100644 --- a/cmd/yorkie/project/create.go +++ b/cmd/yorkie/project/create.go @@ -38,7 +38,7 @@ func newCreateCommand() *cobra.Command { Example: "yorkie project create sample-project", PreRunE: func(cmd *cobra.Command, args []string) error { if err := viper.ReadInConfig(); err != nil { - return err + return fmt.Errorf("failed to read in config: %w", err) } return nil }, diff --git a/cmd/yorkie/project/list.go b/cmd/yorkie/project/list.go index 2a0e64948..bdbf766e6 100644 --- a/cmd/yorkie/project/list.go +++ b/cmd/yorkie/project/list.go @@ -18,6 +18,7 @@ package project import ( "context" + "fmt" "time" "github.com/jedib0t/go-pretty/v6/table" @@ -35,7 +36,7 @@ func newListCommand() *cobra.Command { Short: "List all projects", PreRunE: func(cmd *cobra.Command, args []string) error { if err := viper.ReadInConfig(); err != nil { - return err + return fmt.Errorf("failed to read in config: %w", err) } return nil }, diff --git a/cmd/yorkie/project/update.go b/cmd/yorkie/project/update.go index c2175819c..64c926de6 100644 --- a/cmd/yorkie/project/update.go +++ b/cmd/yorkie/project/update.go @@ -45,7 +45,7 @@ func newUpdateCommand() *cobra.Command { Example: "yorkie project update name [options]", PreRunE: func(cmd *cobra.Command, args []string) error { if err := viper.ReadInConfig(); err != nil { - return err + return fmt.Errorf("failed to read in config: %w", err) } return nil },