feat(cli): improve API error parsing and display (#829)

This commit is contained in:
Scott Densmore
2025-06-07 22:04:57 -07:00
committed by GitHub
parent 6e4b84a60d
commit b46f220931
3 changed files with 116 additions and 1 deletions

View File

@@ -28,6 +28,7 @@ import {
ToolCallStatus,
} from '../types.js';
import { isAtCommand } from '../utils/commandUtils.js';
import { parseAndFormatApiError } from '../utils/errorParsing.js';
import { useShellCommandProcessor } from './shellCommandProcessor.js';
import { handleAtCommand } from './atCommandProcessor.js';
import { findLastSafeSplitPoint } from '../utils/markdownUtilities.js';
@@ -467,7 +468,9 @@ export const useGeminiStream = (
addItem(
{
type: MessageType.ERROR,
text: `[Stream Error: ${getErrorMessage(error) || 'Unknown error'}]`,
text: parseAndFormatApiError(
getErrorMessage(error) || 'Unknown error',
),
},
userMessageTimestamp,
);