cherry-pick(#28239): fix: collect all errors in removeFolders (#28243)

This PR cherry-picks the following commits:

- 440f5e5d2b

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Playwright Service 2023-11-20 12:48:34 -08:00 committed by GitHub
parent b8949166dc
commit e27bc9faa8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -28,8 +28,8 @@ export async function mkdirIfNeeded(filePath: string) {
export async function removeFolders(dirs: string[]): Promise<Error[]> {
return await Promise.all(dirs.map((dir: string) =>
fs.promises.rm(dir, { recursive: true, force: true, maxRetries: 10 })
)).catch(e => e);
fs.promises.rm(dir, { recursive: true, force: true, maxRetries: 10 }).catch(e => e)
));
}
export function canAccessFile(file: string) {