catch more errors!

This commit is contained in:
Luke Berndt
2023-04-10 15:02:59 -04:00
parent 13ade5c6cb
commit 1fce1d5eef

View File

@@ -181,9 +181,11 @@ exports.upload = async function (req, res, next) {
success: false, success: false,
error: "File Upload" error: "File Upload"
}));*/ }));*/
fs.unlink(req.file.path, (err) => { try {
if (err) fs.unlinkSync(req.file.path);
console.log("error deleting: " + req.file.path); } catch (err) {
}); console.warn("There was an Error uploading an deleting: " + req.file.path);
};
} }
} }