Add error handling for failed window loads in electron/main.cjs

This commit is contained in:
2026-03-20 16:04:00 +01:00
parent af39c0af7f
commit 490c58f528

View File

@@ -345,6 +345,10 @@ async function createMainWindow() {
applyUiScaleToWindow(mainWindow)
})
mainWindow.webContents.on('did-fail-load', (_event, errorCode, errorDescription, validatedURL) => {
console.error('Main window failed to load:', { errorCode, errorDescription, validatedURL })
})
mainWindow.on('focus', () => {
mainWindow.webContents.send('window-focused')
})
@@ -392,6 +396,10 @@ async function createSettingsWindow() {
applyUiScaleToWindow(settingsWindow)
})
settingsWindow.webContents.on('did-fail-load', (_event, errorCode, errorDescription, validatedURL) => {
console.error('Settings window failed to load:', { errorCode, errorDescription, validatedURL })
})
settingsWindow.on('closed', () => {
settingsWindow = null
})