Skip to content

Commit 98a3abc

Browse files
authored
Ignore file not found errors in temp state (#8720)
1 parent 4947e69 commit 98a3abc

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/common/temporaryState.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,10 @@ export class TemporaryState extends vscode.Disposable {
110110
try {
111111
await vscode.workspace.fs.delete(tempState.path, { recursive: true });
112112
} catch (e) {
113-
Logger.appendLine(`Error in initialization: ${e.message}`, TemporaryState.ID);
113+
// Ignore FileNotFound errors - the temp directory may not exist yet on first run.
114+
if (!(e instanceof vscode.FileSystemError) || e.code !== 'FileNotFound') {
115+
Logger.appendLine(`Error in initialization: ${e.message}`, TemporaryState.ID);
116+
}
114117
}
115118
try {
116119
await vscode.workspace.fs.createDirectory(tempState.path);

0 commit comments

Comments
 (0)