module.exports = (error, res, next) => {
  if (error.message.includes('references a non existing ID')) {
    const errors = {};
    _.each(error.errors, (val, key) => {
      Object.assign(errors, {