mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-10 22:21:22 -07:00
migrate console.error to coreEvents for mcp-client-manager and google-auth-provider (#12342)
This commit is contained in:
@@ -14,6 +14,7 @@ import type {
|
||||
import { GoogleAuth } from 'google-auth-library';
|
||||
import type { MCPServerConfig } from '../config/config.js';
|
||||
import { FIVE_MIN_BUFFER_MS } from './oauth-utils.js';
|
||||
import { coreEvents } from '../utils/events.js';
|
||||
|
||||
const ALLOWED_HOSTS = [/^.+\.googleapis\.com$/, /^(.*\.)?luci\.app$/];
|
||||
|
||||
@@ -85,7 +86,10 @@ export class GoogleCredentialProvider implements OAuthClientProvider {
|
||||
const accessTokenResponse = await client.getAccessToken();
|
||||
|
||||
if (!accessTokenResponse.token) {
|
||||
console.error('Failed to get access token from Google ADC');
|
||||
coreEvents.emitFeedback(
|
||||
'error',
|
||||
'Failed to get access token from Google ADC',
|
||||
);
|
||||
return undefined;
|
||||
}
|
||||
|
||||
|
||||
@@ -220,8 +220,10 @@ export class McpClientManager {
|
||||
try {
|
||||
await client.disconnect();
|
||||
} catch (error) {
|
||||
console.error(
|
||||
`Error stopping client '${name}': ${getErrorMessage(error)}`,
|
||||
coreEvents.emitFeedback(
|
||||
'error',
|
||||
`Error stopping client '${name}':`,
|
||||
error,
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user