mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 08:47:44 +00:00
Fix circular reference JSON serialization in telemetry logging (#4150)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user