Skip to content

Commit 165e65b

Browse files
Copilotalexr00
andcommitted
Improve error handling in directory creation - only ignore FileExists errors
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
1 parent d2ecf30 commit 165e65b

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/github/createPRViewProvider.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,11 @@ export class CreatePullRequestViewProvider extends BaseCreatePullRequestViewProv
927927
try {
928928
await vscode.workspace.fs.createDirectory(currentPath);
929929
} catch (e) {
930-
// Directory might already exist, which is fine
930+
// Re-throw if it's not a FileSystemError about the directory already existing
931+
if (e instanceof vscode.FileSystemError && e.code !== 'FileExists') {
932+
throw e;
933+
}
934+
// Directory already exists, which is fine
931935
}
932936
}
933937

0 commit comments

Comments
 (0)