fix: handle ENOENT on file deletion, closes #10645

This commit is contained in:
Julian Lam
2022-06-17 15:09:45 -04:00
parent 05c30677f5
commit 43f9e6c8e4
3 changed files with 9 additions and 2 deletions

View File

@@ -107,6 +107,11 @@ file.delete = async function (path) {
try {
await fs.promises.unlink(path);
} catch (err) {
if (err.code === 'ENOENT') {
winston.verbose(`[file] Attempted to delete non-existent file: ${path}`);
return;
}
winston.warn(err);
}
};