class NotFoundError extends Error { statusCode : number = 404 ; name : string = 'NotFound' ; constructor ( ... args ) { super ( ... args ) ; if ( Error . captureStackTrace && typeof Error . captureStackTrace === 'function' ) { Error . captureStackTrace ( this , NotFoundError ) ; } } setStatusCode ( code ) { this . statusCode = code ; } getStatusCode ( ) { return this . statusCode ; } set code ( code ) { this . statusCode = code ; } get code ( ) : number { return this . statusCode ; } } export default NotFoundError ;