import { NextFunction , Request , Response } from "express" ; import { GenericError } from "../interfaces/generic-error.interface" ; export function handleErrors ( err , _ , res , next ) { const { status = 500 , message } = err ; return res . status ( status ) . send ( message ) ; }