import { Request , Response , NextFunction } from '../types' ; import { ErrorController } from '../controller' ; import { IDinoErrorController } from '../interfaces' ; export class DinoErrorController implements IDinoErrorController { private controller : ErrorController ; constructor ( controller ) { this . controller = controller ; } patch ( err , req , res , next ) { this . controller . request = req ; this . controller . response = res ; this . controller . next = next ; this . controller . error = err ; } invoke ( actionName ) { this . controller [ actionName ] ( ) ; } static create ( controller ) { return new DinoErrorController ( controller ) ; } }