mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 19:18:59 +01:00
debt - move error handler code
This commit is contained in:
@@ -17,7 +17,7 @@ import { ExtHostExtensionService } from 'vs/workbench/api/node/extHostExtensionS
|
||||
import { ExtHostThreadService } from 'vs/workbench/services/thread/common/extHostThreadService';
|
||||
import { RemoteTelemetryService } from 'vs/workbench/api/node/extHostTelemetry';
|
||||
import { IWorkspaceContextService, WorkspaceContextService } from 'vs/platform/workspace/common/workspace';
|
||||
import { IInitData, IEnvironment } from 'vs/workbench/api/node/extHost.protocol';
|
||||
import { IInitData, IEnvironment, MainContext } from 'vs/workbench/api/node/extHost.protocol';
|
||||
import * as errors from 'vs/base/common/errors';
|
||||
|
||||
const nativeExit = process.exit.bind(process);
|
||||
@@ -54,6 +54,10 @@ export class ExtensionHostMain {
|
||||
|
||||
this._extensionService = new ExtHostExtensionService(initData.extensions, threadService, telemetryService, { _serviceBrand: 'optionalArgs', workspaceStoragePath });
|
||||
|
||||
// Error forwarding
|
||||
const mainThreadErrors = threadService.get(MainContext.MainThreadErrors);
|
||||
errors.setUnexpectedErrorHandler(err => mainThreadErrors.onUnexpectedExtHostError(errors.transformErrorForSerialization(err)));
|
||||
|
||||
// Create the ext host API
|
||||
const factory = createApiFactory(initData.configuration, initData.telemetryInfo, threadService, this._extensionService, this._contextService);
|
||||
defineAPI(factory, this._extensionService);
|
||||
|
||||
Reference in New Issue
Block a user