mirror of
https://github.com/openmhz/trunk-server.git
synced 2026-11-12 08:47:40 -05:00
catch more errors!
This commit is contained in:
@@ -181,9 +181,11 @@ exports.upload = async function (req, res, next) {
|
||||
success: false,
|
||||
error: "File Upload"
|
||||
}));*/
|
||||
fs.unlink(req.file.path, (err) => {
|
||||
if (err)
|
||||
console.log("error deleting: " + req.file.path);
|
||||
});
|
||||
try {
|
||||
fs.unlinkSync(req.file.path);
|
||||
} catch (err) {
|
||||
console.warn("There was an Error uploading an deleting: " + req.file.path);
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user