1
0
mirror of https://github.com/garraflavatra/rolens.git synced 2025-01-18 04:57:59 +00:00

Use Wails dialog to report fatal errors

This commit is contained in:
Romein van Buren 2023-06-18 21:46:44 +02:00
parent 0a3f99fa32
commit c751169b7d
Signed by: romein
GPG Key ID: 0EFF8478ADDF6C49

View File

@ -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.",
})
}
}()