mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-28 00:06:53 +01:00
parent
32bd95313a
commit
1c02d73c2c
@ -13,6 +13,7 @@ const legacyFeatureMapper = require('../data-helper/legacy-feature-mapper');
|
||||
const version = 1;
|
||||
|
||||
const handleErrors = (req, res, error) => {
|
||||
logger.warn('Error creating or updating feature', error);
|
||||
switch (error.constructor) {
|
||||
case NotFoundError:
|
||||
return res
|
||||
|
@ -60,6 +60,7 @@ module.exports = function (app, config) {
|
||||
|
||||
joi.validate(data, clientMetricsSchema, (err, cleaned) => {
|
||||
if (err) {
|
||||
logger.warn('Invalid metrics posted', err);
|
||||
return res.status(400).json(err);
|
||||
}
|
||||
|
||||
@ -81,6 +82,7 @@ module.exports = function (app, config) {
|
||||
|
||||
joi.validate(data, clientRegisterSchema, (err, clientRegistration) => {
|
||||
if (err) {
|
||||
logger.warn('Invalid client data posted', err);
|
||||
return res.status(400).json(err);
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,7 @@ const strategySchema = require('./strategy-schema');
|
||||
const version = 1;
|
||||
|
||||
const handleError = (req, res, error) => {
|
||||
logger.warn('Error creating or updating strategy', error);
|
||||
switch (error.name) {
|
||||
case 'NotFoundError':
|
||||
return res
|
||||
|
Loading…
Reference in New Issue
Block a user