Update error codes when process exiting the gemini cli (#13728)

This commit is contained in:
Megha Bansal
2025-11-26 08:13:21 +05:30
committed by GitHub
parent d2a6cff4df
commit d97bbd5324
12 changed files with 307 additions and 192 deletions

View File

@@ -5,7 +5,12 @@
*/
import type { Config } from '@google/gemini-cli-core';
import { AuthType, debugLogger, OutputFormat } from '@google/gemini-cli-core';
import {
AuthType,
debugLogger,
OutputFormat,
ExitCodes,
} from '@google/gemini-cli-core';
import { USER_SETTINGS_PATH } from './config/settings.js';
import { validateAuthMethod } from './config/auth.js';
import { type LoadedSettings } from './config/settings.js';
@@ -63,12 +68,12 @@ export async function validateNonInteractiveAuth(
handleError(
error instanceof Error ? error : new Error(String(error)),
nonInteractiveConfig,
1,
ExitCodes.FATAL_AUTHENTICATION_ERROR,
);
} else {
debugLogger.error(error instanceof Error ? error.message : String(error));
await runExitCleanup();
process.exit(1);
process.exit(ExitCodes.FATAL_AUTHENTICATION_ERROR);
}
}
}