mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-23 11:34:44 -07:00
fix(async): prevent missed async errors from bypassing catch handlers (#13714)
Co-authored-by: Tommaso Sciortino <sciortino@gmail.com>
This commit is contained in:
@@ -1796,12 +1796,8 @@ This extension will run the following MCP servers:
|
||||
});
|
||||
|
||||
it('should throw an error if you request system scope', async () => {
|
||||
await expect(
|
||||
async () =>
|
||||
await extensionManager.disableExtension(
|
||||
'my-extension',
|
||||
SettingScope.System,
|
||||
),
|
||||
await expect(async () =>
|
||||
extensionManager.disableExtension('my-extension', SettingScope.System),
|
||||
).rejects.toThrow('System and SystemDefaults scopes are not supported.');
|
||||
});
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ export async function requestConsentInteractive(
|
||||
consentDescription: string,
|
||||
addExtensionUpdateConfirmationRequest: (value: ConfirmationRequest) => void,
|
||||
): Promise<boolean> {
|
||||
return await promptForConsentInteractive(
|
||||
return promptForConsentInteractive(
|
||||
consentDescription + '\n\nDo you want to continue?',
|
||||
addExtensionUpdateConfirmationRequest,
|
||||
);
|
||||
@@ -89,7 +89,7 @@ async function promptForConsentInteractive(
|
||||
prompt: string,
|
||||
addExtensionUpdateConfirmationRequest: (value: ConfirmationRequest) => void,
|
||||
): Promise<boolean> {
|
||||
return await new Promise<boolean>((resolve) => {
|
||||
return new Promise<boolean>((resolve) => {
|
||||
addExtensionUpdateConfirmationRequest({
|
||||
prompt,
|
||||
onConfirm: (resolvedConfirmed) => {
|
||||
|
||||
@@ -138,7 +138,7 @@ export async function fetchReleaseFromGithub(
|
||||
allowPreRelease?: boolean,
|
||||
): Promise<GithubReleaseData | null> {
|
||||
if (ref) {
|
||||
return await fetchJson(
|
||||
return fetchJson(
|
||||
`https://api.github.com/repos/${owner}/${repo}/releases/tags/${ref}`,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -40,8 +40,6 @@ export class ExtensionStorage {
|
||||
}
|
||||
|
||||
static async createTmpDir(): Promise<string> {
|
||||
return await fs.promises.mkdtemp(
|
||||
path.join(os.tmpdir(), 'gemini-extension'),
|
||||
);
|
||||
return fs.promises.mkdtemp(path.join(os.tmpdir(), 'gemini-extension'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user