Skip to content

Commit

Permalink
feat: add client log
Browse files Browse the repository at this point in the history
  • Loading branch information
HSunboy committed Dec 24, 2024
1 parent f6a1b31 commit afbc16a
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/main/windows/mainWeb/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,21 @@ export function openMainWebWindow(mainWindow: BrowserWindow) {
if (process.platform !== 'darwin') {
mainWindow.setMenu(null);
}

if (process.env.ODC_DEBUG_MODE === 'open' || process.env.NODE_ENV === 'development') {
mainWindow!.webContents.openDevTools();
}

mainWindow.webContents?.on('did-fail-load', (e, code, desc, url, isMainFrame, frameProcId) => {
log.error('webcontent load failed', code, desc, url, isMainFrame, frameProcId);
log.error(e);
});
mainWindow.webContents.on('certificate-error', (e) => {
log.error('certificate-error', e);
});
mainWindow.webContents.on('render-process-gone', (e, details) => {
log.error('render-process-gone', details.reason, details.exitCode);
log.error(e);
});
mainWindow!.loadURL(PathnameStore.getUrl()).catch((e) => {
log.error('loadURL error', e);
dialog.showErrorBox(
Expand Down

0 comments on commit afbc16a

Please sign in to comment.