refactor(cli): consolidate getErrorMessage utility to core (#22190)

This commit is contained in:
Tommaso Sciortino
2026-03-13 15:40:29 +00:00
committed by GitHub
parent 8d0b2d7f1b
commit 2a7e602356
25 changed files with 56 additions and 74 deletions

View File

@@ -18,16 +18,10 @@ import {
isFatalToolError,
debugLogger,
coreEvents,
getErrorMessage,
} from '@google/gemini-cli-core';
import { runSyncCleanup } from './cleanup.js';
export function getErrorMessage(error: unknown): string {
if (error instanceof Error) {
return error.message;
}
return String(error);
}
interface ErrorWithCode extends Error {
exitCode?: number;
code?: string | number;