diff --git a/src/vs/workbench/services/workspaces/browser/abstractWorkspaceEditingService.ts b/src/vs/workbench/services/workspaces/browser/abstractWorkspaceEditingService.ts index a76834a87de..067eae83070 100644 --- a/src/vs/workbench/services/workspaces/browser/abstractWorkspaceEditingService.ts +++ b/src/vs/workbench/services/workspaces/browser/abstractWorkspaceEditingService.ts @@ -200,8 +200,11 @@ export abstract class AbstractWorkspaceEditingService implements IWorkspaceEditi const remoteAuthority = this.environmentService.configuration.remoteAuthority; const untitledWorkspace = await this.workspacesService.createUntitledWorkspace(folders, remoteAuthority); if (path) { - await this.saveWorkspaceAs(untitledWorkspace, path); - await this.workspacesService.deleteUntitledWorkspace(untitledWorkspace); // https://github.com/microsoft/vscode/issues/100276 + try { + await this.saveWorkspaceAs(untitledWorkspace, path); + } finally { + await this.workspacesService.deleteUntitledWorkspace(untitledWorkspace); // https://github.com/microsoft/vscode/issues/100276 + } } else { path = untitledWorkspace.configPath; }