mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-07-20 09:20:37 +02:00
fix: handle ENOENT on file deletion, closes #10645
This commit is contained in:
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user