From ed71512b9b3be3e67143f9236f780850312bc665 Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Fri, 4 Nov 2022 11:39:25 -0700 Subject: [PATCH] Skip debug tree error in telemetry (#165535) Fix #164053 --- src/vs/workbench/contrib/debug/browser/repl.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/debug/browser/repl.ts b/src/vs/workbench/contrib/debug/browser/repl.ts index 7693744bcb248..9b546ce7cec41 100644 --- a/src/vs/workbench/contrib/debug/browser/repl.ts +++ b/src/vs/workbench/contrib/debug/browser/repl.ts @@ -49,6 +49,7 @@ import { ServiceCollection } from 'vs/platform/instantiation/common/serviceColle import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; import { WorkbenchAsyncDataTree } from 'vs/platform/list/browser/listService'; +import { ILogService } from 'vs/platform/log/common/log'; import { IOpenerService } from 'vs/platform/opener/common/opener'; import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; @@ -129,6 +130,7 @@ export class Repl extends FilterViewPane implements IHistoryNavigationWidget { @ITelemetryService telemetryService: ITelemetryService, @IMenuService menuService: IMenuService, @ILanguageFeaturesService private readonly languageFeaturesService: ILanguageFeaturesService, + @ILogService private readonly logService: ILogService, ) { const filterText = storageService.get(FILTER_VALUE_STORAGE_KEY, StorageScope.WORKSPACE, ''); super({ @@ -401,7 +403,13 @@ export class Repl extends FilterViewPane implements IHistoryNavigationWidget { }); if (this.tree && treeInput !== session) { - await this.tree.setInput(session); + try { + await this.tree.setInput(session); + } catch (err) { + // Ignore error because this may happen multiple times while refreshing, + // then changing the root may fail. Log to help with debugging if needed. + this.logService.error(err); + } revealLastElement(this.tree); } }