{"size": 391, "ext": "js", "max_stars_repo_path": "src/utils/error.js", "max_stars_repo_name": "FreezyAG/single-user-accounting-app", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/utils/error.js", "max_issues_repo_name": "FreezyAG/single-user-accounting-app", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/utils/error.js", "max_forks_repo_name": "FreezyAG/single-user-accounting-app", "max_forks_repo_forks_event_min_datetime": "2021-05-18T15:21:45.000Z", "max_forks_repo_forks_event_max_datetime": "2021-05-18T15:21:45.000Z"}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 20.5789473684, "max_line_length": 59, "alphanum_fraction": 0.641943734}
exports.globalErrorHandler = (error, _req, res, _next) => {
  const status = error.statusCode || 500;
  const {message} = error;
  const {data} = error;

  res.status(status).json({
    error: true,
    statusCode: status,
    message,
    data,
  });
};

exports.throwError = (message, statusCode) => {
  const error = new Error(message);
  error.statusCode = statusCode;
  throw error;
};
