diff --git a/src/vs/platform/sharedProcess/electron-main/sharedProcess.ts b/src/vs/platform/sharedProcess/electron-main/sharedProcess.ts index 4822785b9565dd28725afd49784f88478538409f..c196c2d918b12fb9ce1c99ba4e73086bee4a3b2d 100644 --- a/src/vs/platform/sharedProcess/electron-main/sharedProcess.ts +++ b/src/vs/platform/sharedProcess/electron-main/sharedProcess.ts @@ -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 { @@ -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 | undefined = undefined; diff --git a/src/vs/platform/windows/electron-main/window.ts b/src/vs/platform/windows/electron-main/window.ts index 58d42ec2595b591e156e8d3c19c5222f590cba7e..6a0a44d144f7e64a9946a0b1db10c5a74f4e42bc 100644 --- a/src/vs/platform/windows/electron-main/window.ts +++ b/src/vs/platform/windows/electron-main/window.ts @@ -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'; @@ -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)}`); + } } }