function sendError(comment, res = { status: () => ({ json: () => {} }) }, err = null, code = 500) {
   console.error(comment, err);
   res.status(code).json({
      error: {
         message: comment,
         code: code,
         error: err
      }
   });
}

module.exports = {
   sendError
}