do not send error message

This commit is contained in:
hippoz 2020-10-02 23:39:17 +03:00
parent f9c61444b4
commit 27be96572b

View file

@ -92,7 +92,7 @@ app.post('/api/upload', (req, res) => {
return res.status(400).render('uploadfailed', { message: 'A file with that name already exists.' });
} else if(err.code === 'ENOENT') {
file.mv(filepath, (err) => {
if (err) return res.status(500).send(err);
if (err) return res.status(500).render('uploadfailed', { message: 'Something went wrong while uploading the file.' });
res.render('uploaded', { file: { name: file.name } });
});
} else {