export interface Options { code ? : string ; type ? : string ; message ? : string ; origin ? : any ; } export interface Response extends Options { } export interface ExceptionOptions extends Options { status ? : number ; } export class Exception extends Error { private status : number ; private response : Response ; constructor ( options ) { super ( ) ; this . status = options . status || 500 ; this . response = { message : options . message || '' , code : options . code || 'UnknownError' , type : options . type , origin : options . origin || '' , } ; } /**
     * response for client
     */ getResponse ( ) { return this . response ; } /**
     * http status code
     */ getStatus ( ) { return this . status ; } }