1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-03 17:59:37 +02:00

Prepare folders structure for angular app

This commit is contained in:
Chocobozzz 2016-03-07 11:33:59 +01:00
parent b2ff5e3e68
commit b9a3e09ad5
60 changed files with 13 additions and 86 deletions

View file

@ -0,0 +1,25 @@
'use strict'
var util = require('util')
var logger = require('../../helpers/logger')
var reqValidatorsUtils = {
checkErrors: checkErrors
}
function checkErrors (req, res, next, status_code) {
if (status_code === undefined) status_code = 400
var errors = req.validationErrors()
if (errors) {
logger.warn('Incorrect request parameters', { path: req.originalUrl, err: errors })
return res.status(status_code).send('There have been validation errors: ' + util.inspect(errors))
}
return next()
}
// ---------------------------------------------------------------------------
module.exports = reqValidatorsUtils