do not send error message
This commit is contained in:
parent
f9c61444b4
commit
27be96572b
1 changed files with 1 additions and 1 deletions
2
index.js
2
index.js
|
@ -92,7 +92,7 @@ app.post('/api/upload', (req, res) => {
|
||||||
return res.status(400).render('uploadfailed', { message: 'A file with that name already exists.' });
|
return res.status(400).render('uploadfailed', { message: 'A file with that name already exists.' });
|
||||||
} else if(err.code === 'ENOENT') {
|
} else if(err.code === 'ENOENT') {
|
||||||
file.mv(filepath, (err) => {
|
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 } });
|
res.render('uploaded', { file: { name: file.name } });
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue