Skip to content

Commit 5b805e4

Browse files
committed
Crashing workbench process does not bring reopen dialog on linux (fix microsoft#135950)
1 parent 426f82c commit 5b805e4

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/vs/platform/sharedProcess/electron-main/sharedProcess.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { ISharedProcess, ISharedProcessConfiguration } from 'vs/platform/sharedP
2020
import { ISharedProcessWorkerConfiguration } from 'vs/platform/sharedProcess/common/sharedProcessWorkerService';
2121
import { IThemeMainService } from 'vs/platform/theme/electron-main/themeMainService';
2222
import { WindowError } from 'vs/platform/windows/electron-main/windows';
23+
import { toErrorMessage } from 'vs/base/common/errorMessage';
2324

2425
export class SharedProcess extends Disposable implements ISharedProcess {
2526

@@ -157,7 +158,11 @@ export class SharedProcess extends Disposable implements ISharedProcess {
157158
return;
158159
}
159160

160-
window.webContents.send(channel, ...args);
161+
try {
162+
window.webContents.send(channel, ...args);
163+
} catch (error) {
164+
this.logService.warn(`Error sending IPC message to channel '${channel}' of shared process: ${toErrorMessage(error)}`);
165+
}
161166
}
162167

163168
private _whenReady: Promise<void> | undefined = undefined;

src/vs/platform/windows/electron-main/window.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import { app, BrowserWindow, BrowserWindowConstructorOptions, Display, Event, nativeImage, NativeImage, Rectangle, screen, SegmentedControlSegment, systemPreferences, TouchBar, TouchBarSegmentedControl, WebFrameMain } from 'electron';
77
import { RunOnceScheduler } from 'vs/base/common/async';
88
import { CancellationToken } from 'vs/base/common/cancellation';
9+
import { toErrorMessage } from 'vs/base/common/errorMessage';
910
import { Emitter } from 'vs/base/common/event';
1011
import { mnemonicButtonLabel } from 'vs/base/common/labels';
1112
import { Disposable } from 'vs/base/common/lifecycle';
@@ -1319,7 +1320,11 @@ export class CodeWindow extends Disposable implements ICodeWindow {
13191320
return;
13201321
}
13211322

1322-
this._win.webContents.send(channel, ...args);
1323+
try {
1324+
this._win.webContents.send(channel, ...args);
1325+
} catch (error) {
1326+
this.logService.warn(`Error sending IPC message to channel '${channel}' of window ${this._id}: ${toErrorMessage(error)}`);
1327+
}
13231328
}
13241329
}
13251330

0 commit comments

Comments
 (0)