Fix error messages

This commit is contained in:
Johannes Zellner
2019-04-11 13:35:33 +02:00
parent b92a79eb9d
commit 0c8cf9cc0d

View File

@@ -214,8 +214,8 @@ function configureApp(req, res, next) {
if (data.label && typeof data.label !== 'string') return next(new HttpError(400, 'label must be a non-empty string'));
if (data.tags) {
if (!Array.isArray(data.tags)) return next(new HttpError(400, 'tags must be a string array'));
if (data.tags.some(d => typeof d !== 'string')) return next(new HttpError(400, 'tags must be in array of strings'));
if (!Array.isArray(data.tags)) return next(new HttpError(400, 'tags must be an array of strings'));
if (data.tags.some(d => typeof d !== 'string')) return next(new HttpError(400, 'tags must be an array of strings'));
}
if ('dataDir' in data && typeof data.dataDir !== 'string') return next(new HttpError(400, 'dataDir must be a string'));