From e9804d25f96b196fa8b5790c6baed718dceabe14 Mon Sep 17 00:00:00 2001 From: Abdul Rahman ArM <39548998+invarrow@users.noreply.github.com> Date: Wed, 12 Mar 2025 22:43:53 +0530 Subject: [PATCH] fix: resolve circular JSON structure error in search function (#1330) Modified error handlers to avoid logging entire response objects that contain circular references --- apps/api/src/search/googlesearch.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/api/src/search/googlesearch.ts b/apps/api/src/search/googlesearch.ts index 3389ef91..8e6eade0 100644 --- a/apps/api/src/search/googlesearch.ts +++ b/apps/api/src/search/googlesearch.ts @@ -57,7 +57,10 @@ async function _req( return resp; } catch (error) { if (error.response && error.response.status === 429) { - logger.warn("Google Search: Too many requests, try again later.", error.response); + logger.warn("Google Search: Too many requests, try again later.", { + status: error.response.status, + statusText: error.response.statusText + }); throw new Error("Google Search: Too many requests, try again later."); } throw error;