Skip to content

Commit

Permalink
fix: display error messages (#2418)
Browse files Browse the repository at this point in the history
* fix: display error messages

* feat: add extra line

* fix: kubeconfig file
  • Loading branch information
jokestax authored Feb 18, 2025
1 parent 5aa1e2e commit fc9145b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"github.com/konstructio/kubefirst/cmd/k3s"
"github.com/konstructio/kubefirst/cmd/vultr"
"github.com/konstructio/kubefirst/internal/common"
"github.com/konstructio/kubefirst/internal/step"
"github.com/spf13/cobra"
)

Expand Down Expand Up @@ -73,6 +74,8 @@ func Execute() {
// Before removing next line, please read ticket above.
common.CheckForVersionUpdate()
if err := rootCmd.Execute(); err != nil {
fmt.Println()
fmt.Fprintln(output, step.EmojiError, "Error:", err)
fmt.Fprintln(output, "If a detailed error message was available, please make the necessary corrections before retrying.")
fmt.Fprintln(output, "You can re-run the last command to try the operation again.")
os.Exit(0)
Expand Down
4 changes: 2 additions & 2 deletions internal/launch/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,9 @@ func Up(ctx context.Context, additionalHelmFlags []string, inCluster, useTelemet
_, _, err := shell.ExecShellReturnStrings(
k3dClient,
"kubeconfig",
"get",
"write",
consoleClusterName,
"--output",
"-o",
kubeconfigPath,
)
if err != nil {
Expand Down

0 comments on commit fc9145b

Please sign in to comment.