Skip to content

Commit 0ac17fc

Browse files
committed
Don't report ENOENT trying to delete config files
This is caused by a race, but it's harmless and fastest to just let it happen. The end result is exactly what we want (the file is gone), so we just ignore it.
1 parent 537e72a commit 0ac17fc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/browsers.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ export async function checkBrowserConfig(configPath: string) {
4343

4444
console.warn('Failed to read browser config on startup', error);
4545
return deleteFile(browserConfig).catch((err) => {
46+
// We can have a race if the file was invalid AND old, which case we can get a parse error
47+
// and have deleted the file already. Regardless: it's now gone, so we're all good.
48+
if (err.code === 'ENOENT') return;
49+
4650
console.error('Failed to clear broken config file:', err);
4751
reportError(err);
4852
});

0 commit comments

Comments
 (0)