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:
@@ -57,7 +57,10 @@ async function _req(
|
|||||||
return resp;
|
return resp;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.response && error.response.status === 429) {
|
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 new Error("Google Search: Too many requests, try again later.");
|
||||||
}
|
}
|
||||||
throw error;
|
throw error;
|
||||||
|
|||||||
Reference in New Issue
Block a user