aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/videos.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-09-06 16:35:40 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-09-06 17:28:20 +0200
commit77a5501f6413aff2f2a626b929dfda486fa9a3e6 (patch)
tree9f286d1b5a3bede13ea746530c8210c49a064b39 /server/middlewares/validators/videos.ts
parent5c98d3bf078852043cbdd582c01e3dc4f4b5b79f (diff)
downloadPeerTube-77a5501f6413aff2f2a626b929dfda486fa9a3e6.tar.gz
PeerTube-77a5501f6413aff2f2a626b929dfda486fa9a3e6.tar.zst
PeerTube-77a5501f6413aff2f2a626b929dfda486fa9a3e6.zip
Fix tests and user quota
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