Improve Auth error messaging (#1358)

This commit is contained in:
Tommaso Sciortino
2025-06-23 18:37:41 -07:00
committed by GitHub
parent 104f23da90
commit 0abd2a644e
9 changed files with 57 additions and 31 deletions

View File

@@ -22,7 +22,7 @@ import {
GitService,
EditorType,
ThoughtSummary,
isAuthError,
UnauthorizedError,
UserPromptEvent,
} from '@gemini-cli/core';
import { type Part, type PartListUnion } from '@google/genai';
@@ -537,7 +537,7 @@ export const useGeminiStream = (
'GEMINI_DEBUG: Caught error in useGeminiStream.ts:',
JSON.stringify(error),
);
if (isAuthError(error)) {
if (error instanceof UnauthorizedError) {
onAuthError();
} else if (!isNodeError(error) || error.name !== 'AbortError') {
addItem(