From 911875665dcc46005a7e0b8de0ff6553fb47e750 Mon Sep 17 00:00:00 2001 From: Akos Kitta Date: Mon, 1 Feb 2021 13:05:27 +0100 Subject: [PATCH] Do not bail when wiping the temp sketch has failed Signed-off-by: Akos Kitta --- .../src/browser/contributions/save-as-sketch.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arduino-ide-extension/src/browser/contributions/save-as-sketch.ts b/arduino-ide-extension/src/browser/contributions/save-as-sketch.ts index 78acbbb5..3b289bb4 100644 --- a/arduino-ide-extension/src/browser/contributions/save-as-sketch.ts +++ b/arduino-ide-extension/src/browser/contributions/save-as-sketch.ts @@ -61,7 +61,9 @@ export class SaveAsSketch extends SketchContribution { const workspaceUri = await this.sketchService.copy(sketch, { destinationUri }); if (workspaceUri && openAfterMove) { if (wipeOriginal || (openAfterMove && execOnlyIfTemp)) { - await this.fileService.delete(new URI(sketch.uri), { recursive: true }); + try { + await this.fileService.delete(new URI(sketch.uri), { recursive: true }); + } catch { /* NOOP: from time to time, it's not possible to wipe the old resource from the temp dir on Windows */ } } this.workspaceService.open(new URI(workspaceUri), { preserveWindow: true }); }