mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-11 06:31:01 -07:00
fix(core): add error logging for IDE fetch failures (#17981)
This commit is contained in:
committed by
GitHub
parent
1a8d77329e
commit
b79e5ce56d
@@ -215,13 +215,19 @@ export async function createProxyAwareFetch(ideServerHost: string) {
|
||||
};
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
||||
const options = fetchOptions as unknown as import('undici').RequestInit;
|
||||
const response = await fetchFn(url, options);
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
||||
return new Response(response.body as ReadableStream<unknown> | null, {
|
||||
status: response.status,
|
||||
statusText: response.statusText,
|
||||
headers: [...response.headers.entries()],
|
||||
});
|
||||
try {
|
||||
const response = await fetchFn(url, options);
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
||||
return new Response(response.body as ReadableStream<unknown> | null, {
|
||||
status: response.status,
|
||||
statusText: response.statusText,
|
||||
headers: [...response.headers.entries()],
|
||||
});
|
||||
} catch (error) {
|
||||
const urlString = typeof url === 'string' ? url : url.href;
|
||||
logger.error(`IDE fetch failed for ${urlString}`, error);
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user