From bbc679be0e1694289e33744b643a861fba5bd1d2 Mon Sep 17 00:00:00 2001 From: fenglixa Date: Sun, 2 Jun 2019 13:26:42 +0800 Subject: [PATCH] modify to exit.Unavailable and align the code --- cmd/minikube/cmd/dashboard.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cmd/minikube/cmd/dashboard.go b/cmd/minikube/cmd/dashboard.go index f45dae902edd..fafe742fb0ab 100644 --- a/cmd/minikube/cmd/dashboard.go +++ b/cmd/minikube/cmd/dashboard.go @@ -72,12 +72,11 @@ var dashboardCmd = &cobra.Command{ exit.WithError("Error getting client", err) } - _, err = api.Load(pkg_config.GetMachineName()) - if err != nil { + if _, err = api.Load(pkg_config.GetMachineName()); err != nil { switch err := errors.Cause(err).(type) { case mcnerror.ErrHostDoesNotExist: console.OutStyle(console.Meh, "%q cluster does not exist", pkg_config.GetMachineName()) - os.Exit(0) + os.Exit(exit.Unavailable) default: exit.WithError("Error getting cluster", err) }