From f8962e2a80d21c3e84123361d5e84bcb42a1b358 Mon Sep 17 00:00:00 2001 From: Eduard Marbach Date: Sat, 16 Nov 2024 23:10:08 +0100 Subject: [PATCH] refactor: improve ky error log --- src/__generated__/ky-client.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/__generated__/ky-client.ts b/src/__generated__/ky-client.ts index a60229b..5800c45 100644 --- a/src/__generated__/ky-client.ts +++ b/src/__generated__/ky-client.ts @@ -187,7 +187,7 @@ export class HttpClient { return requestPromise.json(); } catch (error: any) { - logger.debug(`Error creating QualityProfile: ${error?.name}`); + logger.debug(`Error during request with error: ${error?.name}`); if (error instanceof HTTPError) { if (error.response) { @@ -207,8 +207,10 @@ export class HttpClient { // Something happened in setting up the request that triggered an Error logger.error(error, `No request/response information. Unknown error`); } + } else if (error instanceof TypeError) { + logger.error(error, `Probably some connection issues. If not, feel free to open an issue with details to improve handling.`); } else { - logger.error(`An not expected error happened. Feel free to open an issue with details to improve handling.`); + logger.error(error, `An not expected error happened. Feel free to open an issue with details to improve handling.`); } throw error;