export class ErrorWithStatusCode extends Error { private readonly statusCode : number ; constructor ( message , statusCode ) { super ( message ) ; this . statusCode = statusCode ; this . name = this . constructor . name ; } public getStatusCode = ( ) : number => this . statusCode ; }