import { RequestHandler } from 'express' ; import getDatabase from '../database' ; import emitter from '../emitter' ; import { RouteNotFoundException } from '../exceptions' ; param req param res param next const notFound = async ( req , res , next ) => { try { const hooksResult = await emitter . emitFilter ( 'request.not_found' , false , { request : req , response : res } , { database : getDatabase ( ) , schema : req . schema , accountability : req . accountability ?? null , } ) ; if ( hooksResult ) { return next ( ) ; } next ( new RouteNotFoundException ( req . path ) ) ; } catch ( err ) { next ( err ) ; } } ; export default notFound ;