mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 08:47:44 +00:00
Improve Auth error messaging (#1358)
This commit is contained in:
committed by
GitHub
parent
104f23da90
commit
0abd2a644e
@@ -49,7 +49,7 @@ export const useAuthCommand = (
|
||||
const errorMessage =
|
||||
settings.merged.selectedAuthType ===
|
||||
AuthType.LOGIN_WITH_GOOGLE_PERSONAL
|
||||
? `Failed to login. Ensure your Google account is not an enterprise account.
|
||||
? `Failed to login. Ensure your Google account is not a Workspace account.
|
||||
Message: ${getErrorMessage(e)}`
|
||||
: `Failed to login. Message: ${getErrorMessage(e)}`;
|
||||
setAuthError(errorMessage);
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user