{"record":{"id":"ac3c2366ad47cc34","repo":"google-gemini/gemini-cli","slug":"geterrormessage-error","errorCode":null,"errorMessage":"getErrorMessage(error)","messagePattern":"getErrorMessage\\(error\\)","errorType":"exception","errorClass":"FetchError","httpStatus":null,"severity":"error","filePath":"packages/core/src/utils/fetch.ts","lineNumber":501,"sourceCode":"      // If the caller's own signal was already aborted, this is a user-initiated\n      // cancellation (e.g. Ctrl+C), not an internal timeout. Re-throw as a plain\n      // AbortError so the retry layer does NOT treat it as a retryable ETIMEDOUT.\n      if (options?.signal?.aborted) {\n        // Rethrow the original abort reason or the caught error to preserve\n        // the stack trace and any custom abort reason (e.g. from Ctrl+C).\n        throw options.signal.reason ?? error;\n      }\n      throw new FetchError(`Request timed out after ${timeout}ms`, 'ETIMEDOUT');\n    }\n    if (error instanceof PrivateIpError) {\n      throw error;\n    }\n    if (error && typeof error === 'object' && 'cause' in error) {\n      if (error.cause instanceof PrivateIpError) {\n        throw error.cause;\n      }\n    }\n    throw new FetchError(getErrorMessage(error), undefined, { cause: error });\n  } finally {\n    clearTimeout(timeoutId);\n  }\n}\n\nexport function setGlobalProxy(proxy: string) {\n  const trimmedProxy = proxy.trim();\n  currentProxy = trimmedProxy;\n  const noProxy = (\n    process.env['NO_PROXY'] ??\n    process.env['no_proxy'] ??\n    ''\n  )?.trim();\n  undici.setGlobalDispatcher(\n    new undici.EnvHttpProxyAgent({\n      httpProxy: trimmedProxy,\n      httpsProxy: trimmedProxy,\n      noProxy,","sourceCodeStart":483,"sourceCodeEnd":519,"githubUrl":"https://github.com/google-gemini/gemini-cli/blob/6a466a7e2fe2b1255752c1e74f69b31f0216084d/packages/core/src/utils/fetch.ts#L483-L519","documentation":"Generic wrapper around a getErrorMessage(error) call: this branch surfaces the underlying cause of a failed fetch (network error, DNS failure, TLS error, etc.) rather than a timeout or user abort, which are handled by the preceding guards. The message text is whatever the original error carried.","triggerScenarios":"Thrown at packages/core/src/utils/fetch.ts:501 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the wrapped message to identify the real network failure","Verify URL, DNS, proxy, and TLS configuration for the target host","Retry transient network failures via the retry layer"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6a466a7e2fe2b1255752c1e74f69b31f0216084d","analyzedAt":"2026-09-16T18:14:43.978Z","contentChangedAt":"2026-09-16T18:14:43.978Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}