fix(core): explicitly set error names to avoid bundling renaming issues (#23913)

This commit is contained in:
Yuna Seol
2026-03-26 23:40:49 -04:00
committed by GitHub
parent 6f92642524
commit aca8e1af05
4 changed files with 60 additions and 17 deletions

View File

@@ -19,6 +19,7 @@ import {
debugLogger,
coreEvents,
getErrorMessage,
getErrorType,
} from '@google/gemini-cli-core';
import { runSyncCleanup } from './cleanup.js';
@@ -82,7 +83,7 @@ export function handleError(
timestamp: new Date().toISOString(),
status: 'error',
error: {
type: error instanceof Error ? error.constructor.name : 'Error',
type: getErrorType(error),
message: errorMessage,
},
stats: streamFormatter.convertToStreamStats(metrics, 0),
@@ -177,7 +178,7 @@ export function handleCancellationError(config: Config): never {
timestamp: new Date().toISOString(),
status: 'error',
error: {
type: 'FatalCancellationError',
type: getErrorType(cancellationError),
message: cancellationError.message,
},
stats: streamFormatter.convertToStreamStats(metrics, 0),
@@ -218,7 +219,7 @@ export function handleMaxTurnsExceededError(config: Config): never {
timestamp: new Date().toISOString(),
status: 'error',
error: {
type: 'FatalTurnLimitedError',
type: getErrorType(maxTurnsError),
message: maxTurnsError.message,
},
stats: streamFormatter.convertToStreamStats(metrics, 0),