Skip to content

Commit 5922649

Browse files
committed
refactor(@angular-devkit/build-angular): replace try/catch block with catch
Since this is a promise the try/catch block will not catch promise rejections which was the reason for the try/catch block.
1 parent 9807291 commit 5922649

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/angular_devkit/build_angular/src/utils/purge-cache.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@ export async function purgeStaleBuildCache(context: BuilderContext): Promise<voi
2929
.filter((d) => join(basePath, d.name) !== path && d.isDirectory())
3030
.map((d) => {
3131
const subPath = join(basePath, d.name);
32-
try {
33-
return fsPromises.rm(subPath, { force: true, recursive: true, maxRetries: 3 });
34-
} catch {}
32+
33+
return fsPromises
34+
.rm(subPath, { force: true, recursive: true, maxRetries: 3 })
35+
.catch(() => void 0);
3536
});
3637

3738
await Promise.all(entriesToDelete);

0 commit comments

Comments
 (0)