Skip to content
This repository has been archived by the owner on Nov 20, 2020. It is now read-only.

Commit

Permalink
handle panics 😬
Browse files Browse the repository at this point in the history
  • Loading branch information
yolossn committed Sep 13, 2020
1 parent 992ee09 commit 071f7ad
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package main

import (
"log"
"os"

"github.com/jesseduffield/gocui"
"github.com/yolossn/lazykubernetes/pkg/app"
"github.com/yolossn/lazykubernetes/pkg/client"
)
Expand All @@ -9,16 +13,19 @@ func main() {
// Setup k8sClient
k8sClient, err := client.Newk8s()
if err != nil {
panic(err)
log.Fatal("Couldn't connect to the k8s cluster")
}
// _, _ = k8sClient.GetServerInfo()

ui, err := app.NewApp(k8sClient)
if err != nil {
panic(err)
log.Fatal("Something went wrong")
}

err = ui.Run()
if err != nil {
panic(err)
if err == gocui.ErrQuit {
os.Exit(0)
}
log.Fatal("Something went wrong")
}
}

0 comments on commit 071f7ad

Please sign in to comment.