{"record":{"id":"a46fba0adf3479b7","repo":"diegosouzapw/OmniRoute","slug":"network-error","errorCode":"NETWORK_ERROR","errorMessage":"Outbound request failed for ${targetUrl.toString()}","messagePattern":"Outbound request failed for (.+?)","errorType":"error_code","errorClass":"SafeOutboundFetchError","httpStatus":null,"severity":"error","filePath":"src/shared/network/safeOutboundFetch.ts","lineNumber":362,"sourceCode":"      }\n\n      return response;\n    } catch (error) {\n      const normalizedError = normalizeFetchFailure(error, targetUrl.toString(), method, attempt);\n      const shouldRetry =\n        retryConfig.shouldRetryMethod &&\n        attempt < retryConfig.attempts &&\n        normalizedError.isRetryable;\n\n      if (!shouldRetry) {\n        throw normalizedError;\n      }\n\n      await sleep(getBackoffDelay(retryConfig.backoffMs, attempt));\n    }\n  }\n\n  throw new SafeOutboundFetchError(`Outbound request failed for ${targetUrl.toString()}`, {\n    code: \"NETWORK_ERROR\",\n    url: targetUrl.toString(),\n    method,\n    attempts: retryConfig.attempts,\n    isRetryable: false,\n  });\n}\n\nexport function getSafeOutboundFetchErrorStatus(error: unknown) {\n  if (!(error instanceof SafeOutboundFetchError)) return null;\n\n  if (error.code === \"TIMEOUT\") return 504;\n  if (\n    error.code === \"INVALID_URL\" ||\n    error.code === \"URL_GUARD_BLOCKED\" ||\n    error.code === \"REDIRECT_BLOCKED\"\n  ) {\n    return 503;","sourceCodeStart":344,"sourceCodeEnd":380,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/shared/network/safeOutboundFetch.ts#L344-L380","documentation":"Final SafeOutboundFetchError thrown after all retry attempts in safeOutboundFetch were exhausted: every attempt failed with a retryable normalized error (network failure, timeout, 5xx). Code NETWORK_ERROR with the target URL; the underlying cause is attached to the last normalized error.","triggerScenarios":"Thrown at src/shared/network/safeOutboundFetch.ts:362 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the target host is reachable from the proxy server (DNS, firewall, TLS)","Increase retryConfig.attempts or backoffMs for flaky upstreams","Inspect the attached cause/normalizedError for the real failure of the last attempt","Circuit-break or health-check the upstream endpoint if it is persistently down"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}