diff --git a/packages/common/exceptions/http.exception.ts b/packages/common/exceptions/http.exception.ts index 7a841cf489c..540844298e1 100644 --- a/packages/common/exceptions/http.exception.ts +++ b/packages/common/exceptions/http.exception.ts @@ -44,6 +44,8 @@ export class HttpException extends Error { this.initCause(); } + public cause: Error | undefined; + /** * Configures error chaining support * @@ -53,7 +55,6 @@ export class HttpException extends Error { */ public initCause() { if (this.response instanceof Error) { - // @ts-ignore this.cause = this.response; } } diff --git a/packages/common/test/exceptions/http.exception.spec.ts b/packages/common/test/exceptions/http.exception.spec.ts index c15bae1b84d..a880c1bfc53 100644 --- a/packages/common/test/exceptions/http.exception.spec.ts +++ b/packages/common/test/exceptions/http.exception.spec.ts @@ -135,7 +135,6 @@ describe('HttpException', () => { const message = new Error('Some Error'); const error = new HttpException(message, 400); expect(`${error}`).to.be.eql(`HttpException: ${message.message}`); - // @ts-ignore const { cause } = error; expect(cause).to.be.eql(message);