Print a meaningful error mesage on webContents did-fail-load
This commit is contained in:
1 parent
8d8ccb064e
commit
663c54c567
1 file changed
+3
-3
@@ -68,9 +68,9 @@ function createMainWindow() {
|
|||||||
}
|
}
|
||||||
return { action: 'deny' };
|
return { action: 'deny' };
|
||||||
});
|
});
|
||||||
win.webContents.on("did-fail-load", (event) => {
|
win.webContents.on("did-fail-load", (event, errorCode, errorDescription, validatedURL, isMainFrame) => {
|
||||||
log.error(event);
|
log.error(`Failed to load URL: ${validatedURL} with error: ${errorDescription}`);
|
||||||
if (event.isMainFrame && event.errorCode !== -3 && config.data?.url) {
|
if (errorCode !== -3 && config.data?.url) {
|
||||||
loadOfflinePage();
|
loadOfflinePage();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in new issue
Block a user