How to use the server/helpers/logger.error function in server

To help you get started, we’ve selected a few server examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sinfo / cannon-api / server / resources / cv.js View on Github external
CV.findOneAndRemove({id: id}, function(err, cv){
    if (err) {
      log.error({err: err, cv: id}, 'error deleting cv');
      return cb(Boom.internal());
    }
    if (!cv) {
      log.error({err: 'not found', cv: id}, 'error deleting cv');
      return cb(Boom.notFound());
    }

    return cb(null, cv);
  });
}
github sinfo / cannon-api / server / resources / user.js View on Github external
User.findOneAndRemove({id: id}, function(err, user){
    if (err) {
      log.error({err: err, requestedUser: id}, 'error deleting user');
      return cb(Boom.internal());
    }
    if (!user) {
      log.error({err: err, requestedUser: id}, 'error deleting user');
      return cb(Boom.notFound());
    }

    return cb(null, user);
  });
}
github sinfo / cannon-api / server / resources / cv.js View on Github external
CV.create(cv, function(err, _cv) {
    if (err) {
      if(err.code == 11000) {
        return cb(Boom.conflict('cv is a duplicate'));
      }

      log.error({err: err, cv: cv.id}, 'error creating cv');
      return cb(Boom.internal());
    }

    cb(null, _cv.toObject({ getters: true }));
  });
}
github sinfo / cannon-api / server / resources / cv.js View on Github external
CV.findOne({id: id}, fields, function(err, cv) {
    if (err) {
      log.error({err: err, cv: id}, 'error getting cv');
      return cb(Boom.internal());
    }
    if (!cv) {
      log.error({err: 'not found', cv: id}, 'error getting cv');
      return cb(Boom.notFound());
    }

    cb(null, cv);
  });
}
github sinfo / eventdeck / server / resources / meeting.js View on Github external
Meeting.create(meeting, function(err, _meeting) {
    if (err) {
      log.error({ err: err, meeting: meeting}, 'error creating meeting');
      return cb(Boom.internal());
    }

    cb(null, _meeting);
  });
}
github sinfo / cannon-api / server / resources / user.js View on Github external
User.find(filter, fields, options, function(err, users) {
    if (err) {
      log.error({err: err}, 'error getting all users');
      return cb(Boom.internal());
    }

    cb(null, users);
  });
}
github sinfo / cannon-api / server / resources / cv.js View on Github external
CV.findOneAndUpdate({id: id}, cv, options, function(err, _cv) {
    if (err) {
      log.error({err: err, cv: id}, 'error updating cv');
      return cb(Boom.internal());
    }
    if (!_cv) {
      log.error({err: err, cv: id}, 'error updating cv');
      return cb(Boom.notFound());
    }

    cb(null, _cv.toObject({ getters: true }));
  });
}
github sinfo / eventdeck / server / resources / meeting.js View on Github external
Meeting.find(filter,fields,options, function(err, meetings) {
    if (err) {
      log.error({ err: err}, 'error getting all meetings');
      return cb(Boom.internal());
    }
    
    cb(null, meetings);
  });
}
github sinfo / cannon-api / server / resources / user.js View on Github external
User.create(user, function(err, _user) {
    if (err) {
      if(err.code == 11000) {
      	log.warn({err:err, requestedUser: user.id}, 'user is a duplicate');
        return cb(Boom.conflict(dupKeyParser(err.err)+' is a duplicate'));
      }

      log.error({ err: err, user: user.id}, 'error creating user');
      return cb(Boom.internal());
    }

    cb(null, _user.toObject({ getters: true }));
  });
}
github sinfo / eventdeck / server / resources / meeting.js View on Github external
Meeting.findOneAndUpdate(filter, meeting, function(err, _meeting) {
    if (err) {
      log.error({ err: err, meeting: id}, 'error updating meeting');
      return cb(Boom.internal());
    }
    if (!_meeting) {
      log.warn({ err: 'not found', meeting: id}, 'error updating meeting');
      return cb(Boom.notFound());
    }

    cb(null, _meeting);
  });
}