Skip to content

Commit

Permalink
Crashing workbench process does not bring reopen dialog on linux (fix #…
Browse files Browse the repository at this point in the history
  • Loading branch information
bpasero committed Oct 27, 2021
1 parent 426f82c commit 5b805e4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/vs/platform/sharedProcess/electron-main/sharedProcess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { ISharedProcess, ISharedProcessConfiguration } from 'vs/platform/sharedP
import { ISharedProcessWorkerConfiguration } from 'vs/platform/sharedProcess/common/sharedProcessWorkerService';
import { IThemeMainService } from 'vs/platform/theme/electron-main/themeMainService';
import { WindowError } from 'vs/platform/windows/electron-main/windows';
import { toErrorMessage } from 'vs/base/common/errorMessage';

export class SharedProcess extends Disposable implements ISharedProcess {

Expand Down Expand Up @@ -157,7 +158,11 @@ export class SharedProcess extends Disposable implements ISharedProcess {
return;
}

window.webContents.send(channel, ...args);
try {
window.webContents.send(channel, ...args);
} catch (error) {
this.logService.warn(`Error sending IPC message to channel '${channel}' of shared process: ${toErrorMessage(error)}`);
}
}

private _whenReady: Promise<void> | undefined = undefined;
Expand Down
7 changes: 6 additions & 1 deletion src/vs/platform/windows/electron-main/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import { app, BrowserWindow, BrowserWindowConstructorOptions, Display, Event, nativeImage, NativeImage, Rectangle, screen, SegmentedControlSegment, systemPreferences, TouchBar, TouchBarSegmentedControl, WebFrameMain } from 'electron';
import { RunOnceScheduler } from 'vs/base/common/async';
import { CancellationToken } from 'vs/base/common/cancellation';
import { toErrorMessage } from 'vs/base/common/errorMessage';
import { Emitter } from 'vs/base/common/event';
import { mnemonicButtonLabel } from 'vs/base/common/labels';
import { Disposable } from 'vs/base/common/lifecycle';
Expand Down Expand Up @@ -1319,7 +1320,11 @@ export class CodeWindow extends Disposable implements ICodeWindow {
return;
}

this._win.webContents.send(channel, ...args);
try {
this._win.webContents.send(channel, ...args);
} catch (error) {
this.logService.warn(`Error sending IPC message to channel '${channel}' of window ${this._id}: ${toErrorMessage(error)}`);
}
}
}

Expand Down

0 comments on commit 5b805e4

Please sign in to comment.