text: // Generic error handler middleware that catches any or all errors
  // generated by any middleware / routes / controllers
  const errorHandler = (err, req, res, next) => {
  	if (!err.errors) {
  		return next(err);
  	}
  	console.log("SERVER Generic error:");
  	console.error(err.errors);
  
  	res
  		.status(500)
  		.json({
  			success: false,
  			msg: "500 Internal server error."
  		});
  };
  
  module.exports = errorHandler;
  