import { Request, Response } from 'express';

export function errorCode500(error: any, req: Request, res: Response<any, Record<string, any>>) {
  console.warn(`error500 - ${error.message}`);
  req.flash('error', error.message);
  res.status(error.code).json({ error: error.toString() });
}
