Skip to content

Commit

Permalink
modify to exit.Unavailable and align the code
Browse files Browse the repository at this point in the history
  • Loading branch information
fenglixa committed Jun 2, 2019
1 parent d40751f commit bbc679b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cmd/minikube/cmd/dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit bbc679b

Please sign in to comment.