From 0bcaefb8342b58fd591487921dd4c75fc351c615 Mon Sep 17 00:00:00 2001 From: Geoff Langenderfer Date: Fri, 16 Aug 2024 23:20:42 -0700 Subject: [PATCH] fix: ResponseError typescript compile errors this was missing a lot from the javascript class. It should now reflect what's available in the class. And it should stop typescript compile errors. --- packages/helpers/classes/response-error.d.ts | 31 ++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/packages/helpers/classes/response-error.d.ts b/packages/helpers/classes/response-error.d.ts index 74c12513d..de55484cd 100644 --- a/packages/helpers/classes/response-error.d.ts +++ b/packages/helpers/classes/response-error.d.ts @@ -2,7 +2,34 @@ export default class ResponseError extends Error { code: number; message: string; response: { - headers: { [key: string]: string; }; - body: string; + headers: { [key: string]: string }; + body: { + errors?: Array<{ + message: string; + field: string; + help: string; + }>; + [key: string]: any; // Handle any other properties that might be in the body + }; + }; + + constructor(response: any); + + toString(): string; + + toJSON(): { + message: string; + code: number; + response: { + headers: { [key: string]: string }; + body: { + errors?: Array<{ + message: string; + field: string; + help: string; + }>; + [key: string]: any; + }; + }; }; } \ No newline at end of file