From 15e0134be7ebac79c035aac38e80a396c5469bbe Mon Sep 17 00:00:00 2001 From: Fanis Tharropoulos Date: Thu, 12 Dec 2024 15:44:22 +0200 Subject: [PATCH] fix: handle undefined error codes in logger warnings --- src/Typesense/ApiCall.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Typesense/ApiCall.ts b/src/Typesense/ApiCall.ts index 81ec47f..a5bf72b 100644 --- a/src/Typesense/ApiCall.ts +++ b/src/Typesense/ApiCall.ts @@ -306,7 +306,7 @@ export default class ApiCall { this.logger.warn( `Request #${requestNumber}: Request to Node ${ node.index - } failed due to "${error.code} ${error.message}${ + } failed due to "${error?.code ?? ""} ${error.message}${ error.response == null ? "" : " - " + JSON.stringify(error.response?.data)