refactor(core): improve error handling for setGlobalProxy (#12437)

This commit is contained in:
Allen Hutchison
2025-11-03 10:13:52 -08:00
committed by GitHub
parent 19ea68b838
commit 9d642f3bb1
4 changed files with 85 additions and 16 deletions

View File

@@ -58,9 +58,5 @@ export async function fetchWithTimeout(
}
export function setGlobalProxy(proxy: string) {
try {
setGlobalDispatcher(new ProxyAgent(proxy));
} catch (e) {
console.error(`Failed to set proxy: ${getErrorMessage(e)}`);
}
setGlobalDispatcher(new ProxyAgent(proxy));
}