Add error messaging for 429 errors (#1316)

This commit is contained in:
Abhi
2025-06-23 17:30:13 -04:00
committed by GitHub
parent 21e6a36cf1
commit dc76bcc433
7 changed files with 139 additions and 45 deletions

View File

@@ -19,6 +19,8 @@ import {
GenerateContentResponse,
} from '@google/genai';
import { parseAndFormatApiError } from './ui/utils/errorParsing.js';
function getResponseText(response: GenerateContentResponse): string | null {
if (response.candidates && response.candidates.length > 0) {
const candidate = response.candidates[0];
@@ -126,7 +128,7 @@ export async function runNonInteractive(
}
}
} catch (error) {
console.error('Error processing input:', error);
console.error(parseAndFormatApiError(error));
process.exit(1);
} finally {
if (isTelemetrySdkInitialized()) {