]>
git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - middlewares/reqValidators/utils.js
91ead27a5bfda78f10fd3ab2c17732b3a7c475a7
4 var util
= require('util')
5 var logger
= require('../../src/logger')
9 utils
.checkErrors = function (req
, res
, next
, status_code
) {
10 if (status_code
=== undefined) status_code
= 400
11 var errors
= req
.validationErrors()
14 logger
.warn('Incorrect request parameters', { path: req
.originalUrl
, err: errors
})
15 return res
.status(status_code
).send('There have been validation errors: ' + util
.inspect(errors
))
21 module
.exports
= utils