From c751169b7d5b1869d03fb71736f6eeb0e7822b34 Mon Sep 17 00:00:00 2001 From: Romein van Buren Date: Sun, 18 Jun 2023 21:46:44 +0200 Subject: [PATCH] Use Wails dialog to report fatal errors --- main.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index abe0cd5..8998ce0 100644 --- a/main.go +++ b/main.go @@ -7,7 +7,6 @@ import ( "github.com/garraflavatra/rolens/internal" "github.com/garraflavatra/rolens/internal/app" uictrl "github.com/garraflavatra/rolens/internal/ui" - "github.com/ncruces/zenity" "github.com/wailsapp/wails/v2" "github.com/wailsapp/wails/v2/pkg/logger" "github.com/wailsapp/wails/v2/pkg/options" @@ -48,7 +47,11 @@ func main() { defer func() { if p := recover(); p != nil { runtime.LogFatalf(ctx, "Application panicked: %v", p) - zenity.Error("A fatal error occured.") + runtime.MessageDialog(ctx, runtime.MessageDialogOptions{ + Type: runtime.ErrorDialog, + Title: "A fatal error occured!", + Message: "Please try to restart the application, or consult the logs for more details.", + }) } }()