diff --git a/index.js b/index.js index e1e6116..0a365d9 100644 --- a/index.js +++ b/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.' }); } 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 {