mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-14 13:53:02 -07:00
Migrate console to coreEvents.emitFeedback or debugLogger (#15219)
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
import { spawn } from 'node:child_process';
|
||||
import { RELAUNCH_EXIT_CODE } from './processUtils.js';
|
||||
import { writeToStderr } from '@google/gemini-cli-core';
|
||||
|
||||
export async function relaunchOnExitCode(runner: () => Promise<number>) {
|
||||
while (true) {
|
||||
@@ -17,7 +18,11 @@ export async function relaunchOnExitCode(runner: () => Promise<number>) {
|
||||
}
|
||||
} catch (error) {
|
||||
process.stdin.resume();
|
||||
console.error('Fatal error: Failed to relaunch the CLI process.', error);
|
||||
const errorMessage =
|
||||
error instanceof Error ? (error.stack ?? error.message) : String(error);
|
||||
writeToStderr(
|
||||
`Fatal error: Failed to relaunch the CLI process.\n${errorMessage}\n`,
|
||||
);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user