wails/v2/internal
Lea Anthony ca206452cd The panic handling has been ported to v2. Here's a summary of the changes:
## Summary of Changes

**1. Created `v2/internal/frontend/desktop/linux/panic_handler.go`**
- Ported the panic recovery logic from v3
- Includes `getStackTrace()` function for generating readable stack traces
- `handlePanic()` function that recovers from panics and either calls the custom handler or logs the error

**2. Added to `v2/pkg/options/options.go`**
- Added `PanicDetails` struct with `StackTrace`, `Error`, `Time`, and `FullStackTrace` fields
- Added `PanicHandler` type: `func(*PanicDetails)`
- Added `PanicHandler` field to the `App` struct with documentation

**3. Modified `v2/internal/frontend/desktop/linux/frontend.go`**
- Added `defer handlePanic(f.frontendOptions.PanicHandler, f.logger)` to the goroutine in `processMessage()` (line 468)

## Usage Example

Users can now configure a custom panic handler in their v2 Wails application:

```go
app := wails.Run(&options.App{
    Title: "My App",
    // ... other options
    PanicHandler: func(details *options.PanicDetails) {
        // Custom panic handling logic
        log.Printf("Panic occurred at %v: %v\n%s",
            details.Time,
            details.Error,
            details.StackTrace)
        // Could show error dialog, send to error tracking service, etc.
    },
})
```

If no `PanicHandler` is set, panics will be logged via the application logger and the application will continue running instead of crashing with a signal handler error.
2026-01-28 08:09:24 +11:00
..
app fix(logger): respect log level from environment variable in dev mode (#4083) 2025-05-05 19:09:34 +10:00
binding Fix generated enums ordering (#4664) 2025-12-10 18:20:22 +11:00
colour feature/turn off color terminal output of dev command (#1947) 2022-10-20 21:11:20 +11:00
frontend The panic handling has been ported to v2. Here's a summary of the changes: 2026-01-28 08:09:24 +11:00
fs [chore] lint fixes 2023-11-12 12:30:49 +11:00
github Update dependencies. Fix buildvcs compile error 2025-02-08 12:56:06 +11:00
go-common-file-dialog fix windows CI (#4378) 2025-07-01 17:36:12 +10:00
gomod [chore] lint fixes 2023-11-12 12:30:49 +11:00
goversion update go minimum version (#3285) 2024-03-24 17:00:11 +11:00
logger [chore] lint fixes 2023-11-12 12:30:49 +11:00
menumanager chore: fix some comments (#3932) 2024-12-06 14:35:46 +11:00
platform Prevent DLL hijacking by setting default DLL directories on initialization (#4207) 2025-09-24 15:44:58 +10:00
process [chore] lint fixes 2023-11-12 12:30:49 +11:00
project Add support for build tags to the wails project schema and update pro… (#4439) 2025-07-25 20:38:40 +10:00
s fix(v2): Replace ioutl.Discard with io.Discard (#4877) 2026-01-20 11:20:02 +11:00
shell [chore] lint fixes 2023-11-12 12:30:49 +11:00
signal [chore] lint fixes 2023-11-12 12:30:49 +11:00
staticanalysis Bump the go_modules group across 2 directories with 1 update (#3408) 2024-11-17 20:55:06 +11:00
system Added initial Windows 11-supporting branding 2025-01-21 21:15:24 +02:00
typescriptify Fix generated enums ordering (#4664) 2025-12-10 18:20:22 +11:00
webview2runtime [chore] lint fixes 2023-11-12 12:30:49 +11:00
wv2installer [chore] Use webview2 package (#2687) 2023-06-10 17:04:31 +10:00