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 }); }