Skip to content

Commit d30567b

Browse files
committed
don't log errors twice, microsoft#32766
1 parent dd06daf commit d30567b

2 files changed

Lines changed: 11 additions & 8 deletions

File tree

src/bootstrap.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,15 @@ if (!process.env['VSCODE_ALLOW_IO']) {
103103
process.__defineGetter__('stdin', function () { return writable; });
104104
}
105105

106-
// Handle uncaught exceptions
107-
process.on('uncaughtException', function (err) {
108-
console.error('Uncaught Exception: ', err.toString());
109-
if (err.stack) {
110-
console.error(err.stack);
111-
}
112-
});
106+
if (!process.env['VSCODE_HANDLES_UNCAUGHT_ERRORS']) {
107+
// Handle uncaught exceptions
108+
process.on('uncaughtException', function (err) {
109+
console.error('Uncaught Exception: ', err.toString());
110+
if (err.stack) {
111+
console.error(err.stack);
112+
}
113+
});
114+
}
113115

114116
// Kill oneself if one's parent dies. Much drama.
115117
if (process.env['VSCODE_PARENT_PID']) {
@@ -138,4 +140,4 @@ if (typeof crashReporterOptionsRaw === 'string') {
138140
}
139141
}
140142

141-
require('./bootstrap-amd').bootstrap(process.env['AMD_ENTRYPOINT']);
143+
require('./bootstrap-amd').bootstrap(process.env['AMD_ENTRYPOINT']);

src/vs/workbench/services/extensions/electron-browser/extensionHost.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ export class ExtensionHostProcessWorker {
141141
VERBOSE_LOGGING: true,
142142
VSCODE_WINDOW_ID: String(this._windowService.getCurrentWindowId()),
143143
VSCODE_IPC_HOOK_EXTHOST: pipeName,
144+
VSCODE_HANDLES_UNCAUGHT_ERRORS: true,
144145
ELECTRON_NO_ASAR: '1'
145146
}),
146147
// We only detach the extension host on windows. Linux and Mac orphan by default

0 commit comments

Comments
 (0)