From bf61f19e3f2bee7f30c2772bb8ea327de665bb4f Mon Sep 17 00:00:00 2001 From: Alexandru Dima Date: Fri, 10 Jun 2022 16:15:13 +0200 Subject: [PATCH] Try to isolate failing ext host customers (#151743) Try to isolate failing ext host customers (#151147) --- .../extensions/common/extensionHostManager.ts | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/vs/workbench/services/extensions/common/extensionHostManager.ts b/src/vs/workbench/services/extensions/common/extensionHostManager.ts index 1f375896271..b87f73cf184 100644 --- a/src/vs/workbench/services/extensions/common/extensionHostManager.ts +++ b/src/vs/workbench/services/extensions/common/extensionHostManager.ts @@ -294,16 +294,27 @@ class ExtensionHostManager extends Disposable implements IExtensionHostManager { const namedCustomers = ExtHostCustomersRegistry.getNamedCustomers(); for (let i = 0, len = namedCustomers.length; i < len; i++) { const [id, ctor] = namedCustomers[i]; - const instance = this._instantiationService.createInstance(ctor, extHostContext); - this._customers.push(instance); - this._rpcProtocol.set(id, instance); + try { + const instance = this._instantiationService.createInstance(ctor, extHostContext); + this._customers.push(instance); + this._rpcProtocol.set(id, instance); + } catch (err) { + this._logService.critical(`Cannot instantiate named customer: '${id.sid}'`); + this._logService.critical(err); + errors.onUnexpectedError(err); + } } // Customers const customers = ExtHostCustomersRegistry.getCustomers(); for (const ctor of customers) { - const instance = this._instantiationService.createInstance(ctor, extHostContext); - this._customers.push(instance); + try { + const instance = this._instantiationService.createInstance(ctor, extHostContext); + this._customers.push(instance); + } catch (err) { + this._logService.critical(err); + errors.onUnexpectedError(err); + } } if (!extensionHostProxy) {