diff options
| author | Bryan Morgan <[email protected]> | 2025-07-14 16:20:06 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-07-14 20:20:06 +0000 |
| commit | ff3722a3a74b09cd25b03de41933944a55db6351 (patch) | |
| tree | 9777d89dc9f984077a895c3aea2910a34eecf846 /packages/core/src/utils/quotaErrorDetection.ts | |
| parent | 5008aea90d4ea7ac6bb5872f3702f3c7a7878ed0 (diff) | |
Fix circular reference JSON serialization in telemetry logging (#4150)
Diffstat (limited to 'packages/core/src/utils/quotaErrorDetection.ts')
| -rw-r--r-- | packages/core/src/utils/quotaErrorDetection.ts | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/packages/core/src/utils/quotaErrorDetection.ts b/packages/core/src/utils/quotaErrorDetection.ts index a8e87a5d..b07309cd 100644 --- a/packages/core/src/utils/quotaErrorDetection.ts +++ b/packages/core/src/utils/quotaErrorDetection.ts @@ -44,20 +44,9 @@ export function isProQuotaExceededError(error: unknown): boolean { // - "Quota exceeded for quota metric 'Gemini 2.5-preview Pro Requests'" // We use string methods instead of regex to avoid ReDoS vulnerabilities - const checkMessage = (message: string): boolean => { - console.log('[DEBUG] isProQuotaExceededError checking message:', message); - const result = - message.includes("Quota exceeded for quota metric 'Gemini") && - message.includes("Pro Requests'"); - console.log('[DEBUG] isProQuotaExceededError result:', result); - return result; - }; - - // Log the full error object to understand its structure - console.log( - '[DEBUG] isProQuotaExceededError - full error object:', - JSON.stringify(error, null, 2), - ); + const checkMessage = (message: string): boolean => + message.includes("Quota exceeded for quota metric 'Gemini") && + message.includes("Pro Requests'"); if (typeof error === 'string') { return checkMessage(error); |
