import { Middleware , ExpressErrorMiddlewareInterface } from 'routing-controllers' ; @ Middleware ( { type : 'after' } ) export class FilterErrorHandler implements ExpressErrorMiddlewareInterface { error ( error , request , response , next ) { if ( error && error . httpCode && error . httpCode !== 500 ) { next ( null ) ; return ; } next ( error ) ; } }