mirror of
https://github.com/garraflavatra/rolens.git
synced 2025-01-18 13:07:58 +00:00
Use Wails dialog to report fatal errors
This commit is contained in:
parent
0a3f99fa32
commit
c751169b7d
7
main.go
7
main.go
@ -7,7 +7,6 @@ import (
|
|||||||
"github.com/garraflavatra/rolens/internal"
|
"github.com/garraflavatra/rolens/internal"
|
||||||
"github.com/garraflavatra/rolens/internal/app"
|
"github.com/garraflavatra/rolens/internal/app"
|
||||||
uictrl "github.com/garraflavatra/rolens/internal/ui"
|
uictrl "github.com/garraflavatra/rolens/internal/ui"
|
||||||
"github.com/ncruces/zenity"
|
|
||||||
"github.com/wailsapp/wails/v2"
|
"github.com/wailsapp/wails/v2"
|
||||||
"github.com/wailsapp/wails/v2/pkg/logger"
|
"github.com/wailsapp/wails/v2/pkg/logger"
|
||||||
"github.com/wailsapp/wails/v2/pkg/options"
|
"github.com/wailsapp/wails/v2/pkg/options"
|
||||||
@ -48,7 +47,11 @@ func main() {
|
|||||||
defer func() {
|
defer func() {
|
||||||
if p := recover(); p != nil {
|
if p := recover(); p != nil {
|
||||||
runtime.LogFatalf(ctx, "Application panicked: %v", p)
|
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.",
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user