[READ-ONLY] Mirror of https://github.com/probablykasper/ferrum. Music library app for Mac, Linux and Windows ferrum.kasper.space
electron linux macos music music-library music-player napi windows
0

Configure Feed

Select the types of activity you want to include in your feed.

Crash fully on panic

Kasper (Sep 14, 2025, 9:50 AM +0200) 94babb38 28cb8083

+14 -2
+14 -2
src/electron/main.ts
··· 20 20 }) 21 21 } 22 22 23 - async function err_handler(msg: string, error: Error) { 23 + async function err_handler(msg: string, error: Error | string) { 24 24 app.whenReady().then(() => { 25 25 dialog.showMessageBoxSync({ 26 26 type: 'error', 27 27 message: msg, 28 - detail: error.stack, 28 + detail: error instanceof Error ? error.stack : error, 29 29 title: 'Error', 30 30 }) 31 31 trigger_crash() ··· 176 176 main_window.on('closed', () => { 177 177 main_window = null 178 178 browser_windows.main_window = main_window 179 + }) 180 + main_window.webContents.on('render-process-gone', (_e, details) => { 181 + if ( 182 + details.reason !== 'clean-exit' && 183 + details.reason !== 'abnormal-exit' && 184 + details.reason !== 'killed' 185 + ) { 186 + err_handler( 187 + `Crashed with code ${details.exitCode} (${details.reason})`, 188 + 'Error message was likely logged to console.', 189 + ) 190 + } 179 191 }) 180 192 ipc_main.handle('app_loaded', () => { 181 193 app_loaded = true