From 41552d398ec48e87b5f12557d4a4c9f86049bea7 Mon Sep 17 00:00:00 2001 From: Nick Amoscato Date: Fri, 26 May 2023 08:45:00 -0400 Subject: [PATCH] fix(common): loosen http exception cause type resolves #11665 --- packages/common/exceptions/http.exception.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/common/exceptions/http.exception.ts b/packages/common/exceptions/http.exception.ts index 80028769564..36f27e563bc 100644 --- a/packages/common/exceptions/http.exception.ts +++ b/packages/common/exceptions/http.exception.ts @@ -2,7 +2,8 @@ import { Logger } from '../services'; import { isObject, isString } from '../utils/shared.utils'; export interface HttpExceptionOptions { - cause?: Error; + /** original cause of the error */ + cause?: unknown; description?: string; } @@ -67,14 +68,13 @@ export class HttpException extends Error { this.initCause(); } - public cause: Error | undefined; + public cause: unknown; /** * Configures error chaining support * - * See: - * - https://nodejs.org/en/blog/release/v16.9.0/#error-cause - * - https://github.com/microsoft/TypeScript/issues/45167 + * @see https://nodejs.org/en/blog/release/v16.9.0/#error-cause + * @see https://github.com/microsoft/TypeScript/issues/45167 */ public initCause(): void { if (this.options?.cause) {