mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-17 22:31:23 +08:00
added panic catch for gui
This commit is contained in:
@@ -22,6 +22,11 @@ var logoContent embed.FS
|
||||
|
||||
// Run - run's the netclient GUI
|
||||
func Run(networks []string) error {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
logger.Log(0, "No monitor detected, please use CLI commands; use -help for more info.")
|
||||
}
|
||||
}()
|
||||
a := app.New()
|
||||
window := a.NewWindow("Netclient - " + ncutils.Version)
|
||||
|
||||
@@ -100,11 +105,7 @@ func Run(networks []string) error {
|
||||
views.CurrentContent.Add(views.GetView(views.Join))
|
||||
|
||||
window.SetContent(views.CurrentContent)
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
logger.Log(0, "No monitor detected, please use CLI commands; use -help for more info.")
|
||||
}
|
||||
}()
|
||||
window.ShowAndRun()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user