From 2137d5a66b623503c0c2557cdc466edd62a9698e Mon Sep 17 00:00:00 2001 From: Arno Erpenbeck <88486704+arnoerpenbeck@users.noreply.github.com> Date: Wed, 16 Oct 2024 14:27:13 +0200 Subject: [PATCH] chore: fix lint warnings --- src/common/httpClient/error.ts | 8 +------- src/common/httpClient/httpClient.ts | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/common/httpClient/error.ts b/src/common/httpClient/error.ts index 7558582..dff1f2f 100644 --- a/src/common/httpClient/error.ts +++ b/src/common/httpClient/error.ts @@ -14,19 +14,15 @@ export class FetchError extends Error { }; type: ErrorType; - errors?: any[]; status: number; statusText: string; - constructor(status: number, statusText: string, body?: any) { + constructor(status: number, statusText: string) { super(statusText); this.name = FetchError.NAME; this.type = ErrorType.HTTP; this.status = status; this.statusText = statusText; - if (body) { - this.errors = body.errors; - } } } @@ -61,7 +57,6 @@ export class FftApiError extends FftSdkError { return FftSdkError.isSdkError(error) && error.name === FftApiError.NAME && error.type === ErrorType.RESPONSE; } - errors: any[] = []; status?: number; statusText?: string; @@ -93,7 +88,6 @@ export const handleError = (error: unknown): never => { apiError.type = ErrorType.RESPONSE; apiError.status = error.status; apiError.statusText = error.statusText; - apiError.errors = error.errors || []; if (!apiError.message && apiError.statusText) { apiError.message = apiError.statusText; } diff --git a/src/common/httpClient/httpClient.ts b/src/common/httpClient/httpClient.ts index 20f12be..50bbd4e 100644 --- a/src/common/httpClient/httpClient.ts +++ b/src/common/httpClient/httpClient.ts @@ -72,7 +72,7 @@ export class HttpClient implements BasicHttpClient { } if (!response.ok) { - throw new FetchError(response.status, response.statusText, responseBody); + throw new FetchError(response.status, response.statusText); } return {