mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-11 06:31:01 -07:00
Resolve unhandled promise rejection in ide-client.ts (#15587)
This commit is contained in:
@@ -678,6 +678,9 @@ export class IdeClient {
|
||||
noProxy: [existingNoProxy, '127.0.0.1'].filter(Boolean).join(','),
|
||||
});
|
||||
const undiciPromise = import('undici');
|
||||
// Suppress unhandled rejection if the promise is not awaited immediately.
|
||||
// If the import fails, the error will be thrown when awaiting undiciPromise below.
|
||||
undiciPromise.catch(() => {});
|
||||
return async (url: string | URL, init?: RequestInit): Promise<Response> => {
|
||||
const { fetch: fetchFn } = await undiciPromise;
|
||||
const fetchOptions: RequestInit & { dispatcher?: unknown } = {
|
||||
|
||||
Reference in New Issue
Block a user