Add error handling for failed window loads in electron/main.cjs
This commit is contained in:
@@ -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
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user