import { NextFunction , Request , Response } from 'express' ; import logger from '../utils/logger' ; const syntaxError = ( error , req , res , next ) => { if ( error instanceof SyntaxError ) { logger . error ( 'Syntax Error' , { error } ) ; return res . status ( 500 ) . json ( { error : 'SyntaxError' } ) ; } else { next ( ) ; } } ; export default syntaxError ;