Skip to content

Commit d35b73b

Browse files
committed
remove try catch
1 parent ceaac92 commit d35b73b

File tree

1 file changed

+2
-18
lines changed

1 file changed

+2
-18
lines changed

dev-packages/browser-integration-tests/utils/staticAssets.ts

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,7 @@ export function addStaticAssetSymlink(localOutPath: string, originalPath: string
2727

2828
// Only copy files once
2929
if (!fs.existsSync(newPath)) {
30-
try {
31-
fs.symlinkSync(originalPath, newPath);
32-
} catch (error) {
33-
// There must be some race condition here as some of our tests flakey
34-
// because the file already exists. Let's catch and ignore
35-
// only ignore these kind of errors
36-
if (!`${error}`.includes('file already exists')) {
37-
throw error;
38-
}
39-
}
30+
fs.symlinkSync(originalPath, newPath);
4031
}
4132

4233
symlinkAsset(newPath, path.join(localOutPath, fileName));
@@ -49,12 +40,5 @@ function symlinkAsset(originalPath: string, targetPath: string): void {
4940
// ignore errors here
5041
}
5142

52-
try {
53-
fs.linkSync(originalPath, targetPath);
54-
} catch (error) {
55-
// only ignore these kind of errors
56-
if (!`${error}`.includes('file already exists')) {
57-
throw error;
58-
}
59-
}
43+
fs.linkSync(originalPath, targetPath);
6044
}

0 commit comments

Comments
 (0)