Skip to content

Commit

Permalink
Suppress crash from probable race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
Zarel committed Feb 27, 2025
1 parent 557ed50 commit be518c5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/repl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ export const Repl = new class {
socket.end();
socket.destroy();
}).on('error', () => {
fs.unlinkSync(pathname);
try {
// race condition?
fs.unlinkSync(pathname);
} catch {}
});
}
}
Expand Down

0 comments on commit be518c5

Please sign in to comment.