This commit is contained in:
tanzhenxin
2025-12-13 23:04:00 +08:00
parent 3138aa1fe3
commit 0e6ebe85e4

View File

@@ -292,7 +292,7 @@ class GeminiAgent {
private async ensureAuthenticated(config: Config): Promise<void> { private async ensureAuthenticated(config: Config): Promise<void> {
const selectedType = this.settings.merged.security?.auth?.selectedType; const selectedType = this.settings.merged.security?.auth?.selectedType;
if (!selectedType) { if (!selectedType) {
throw acp.RequestError.authRequired(); throw acp.RequestError.authRequired('No Selected Type');
} }
try { try {
@@ -300,7 +300,9 @@ class GeminiAgent {
await config.refreshAuth(selectedType, true); await config.refreshAuth(selectedType, true);
} catch (e) { } catch (e) {
console.error(`Authentication failed: ${e}`); console.error(`Authentication failed: ${e}`);
throw acp.RequestError.authRequired(); throw acp.RequestError.authRequired(
'Authentication failed: ' + (e as Error).message,
);
} }
} }