export class AppError extends Error { public statusCode : number ; constructor ( name , message , code ) { super ( message ) ; if ( Error . captureStackTrace ) { Error . captureStackTrace ( this , AppError ) ; } this . name = name ; this . statusCode = code ; } }