Skip to content

Commit

Permalink
remove try catch
Browse files Browse the repository at this point in the history
  • Loading branch information
mydea committed Aug 14, 2024
1 parent aa1cf99 commit d87049d
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions dev-packages/browser-integration-tests/utils/staticAssets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,7 @@ export function addStaticAssetSymlink(localOutPath: string, originalPath: string

// Only copy files once
if (!fs.existsSync(newPath)) {
try {
fs.symlinkSync(originalPath, newPath);
} catch (error) {
// There must be some race condition here as some of our tests flakey
// because the file already exists. Let's catch and ignore
// only ignore these kind of errors
if (!`${error}`.includes('file already exists')) {
throw error;
}
}
fs.symlinkSync(originalPath, newPath);
}

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

try {
fs.linkSync(originalPath, targetPath);
} catch (error) {
// only ignore these kind of errors
if (!`${error}`.includes('file already exists')) {
throw error;
}
}
fs.linkSync(originalPath, targetPath);
}

0 comments on commit d87049d

Please sign in to comment.