export class Exception extends Error { type { string } public name : string = "HTTP_EXCEPTION" ; /**
     * Message of the exception
     */ public message : string ; type { string } public type : string = "HTTP_EXCEPTION" ; /**
     * Stack calling
     */ public stack : string ; public origin : Error ; /**
     * HTTP Code Status
     */ public status : number ; /**
     *
     */ public body : any ; [ key ] : any ; constructor ( status = 500 , message = "" , origin ? ) { super ( message ) ; this . status = status ; this . message = message ; this . setOrigin ( origin ) ; } setOrigin ( origin ) { if ( origin ) { if ( origin instanceof Error ) { this . origin = origin ; this . message = `${ this . message }, innerException: ${ this . origin . message }` . trim ( ) ; } else if ( typeof origin === "string" ) { this . origin = new Error ( origin ) ; this . message = `${ this . message }, innerException: ${ this . origin . message }` . trim ( ) ; } else { this . body = origin ; } } } toString ( ) { return ( this . name + "(" + this . status + "): " + this . message + " " ) . trim ( ) ; } } export class HTTPException extends Exception { }