migrate console.error to coreEvents for mcp-client-manager and google-auth-provider (#12342)

This commit is contained in:
Sehoon Shon
2025-10-31 14:52:56 -04:00
committed by GitHub
parent ab013fb7e9
commit e9c7a80b12
2 changed files with 9 additions and 3 deletions

View File

@@ -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;
}

View File

@@ -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,
);
}
},