aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/videos.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/middlewares/validators/videos.ts')
-rw-r--r--server/middlewares/validators/videos.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/server/middlewares/validators/videos.ts b/server/middlewares/validators/videos.ts
index ba8c2d834..249da668d 100644
--- a/server/middlewares/validators/videos.ts
+++ b/server/middlewares/validators/videos.ts
@@ -36,6 +36,12 @@ function videosAddValidator (req: express.Request, res: express.Response, next:
36 } 36 }
37 37
38 return db.Video.getDurationFromFile(videoFile.path) 38 return db.Video.getDurationFromFile(videoFile.path)
39 .catch(err => {
40 logger.error('Invalid input file in videosAddValidator.', err)
41 res.status(400).send('Invalid input file.')
42
43 return undefined
44 })
39 }) 45 })
40 .then(duration => { 46 .then(duration => {
41 // Previous test failed, abort 47 // Previous test failed, abort
@@ -51,7 +57,10 @@ function videosAddValidator (req: express.Request, res: express.Response, next:
51 .catch(err => { 57 .catch(err => {
52 logger.error('Error in video add validator', err) 58 logger.error('Error in video add validator', err)
53 res.sendStatus(500) 59 res.sendStatus(500)
60
61 return undefined
54 }) 62 })
63
55 }) 64 })
56} 65}
57 66