fix: resolve circular JSON structure error in search function (#1330)

Modified error handlers to avoid logging entire response objects that contain circular references
This commit is contained in:
Abdul Rahman ArM 2025-03-12 22:43:53 +05:30 committed by GitHub
parent 0154e40685
commit e9804d25f9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;