From 27be96572b1f2986c9418abc6400400f12439890 Mon Sep 17 00:00:00 2001 From: hippoz Date: Fri, 2 Oct 2020 23:39:17 +0300 Subject: [PATCH] do not send error message --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 {