diegosouzapw/OmniRoute · error · Error
Subscription fetch failed: HTTP ${res2.status}
Error message
Subscription fetch failed: HTTP ${res2.status} What it means
Error "Subscription fetch failed: HTTP ${res2.status}" thrown in diegosouzapw/OmniRoute.
Source
Thrown at src/lib/proxySubscription/subscriptionService.ts:344
*/
async function doSafeFetch(url: string, headers: Record<string, string>): Promise<string> {
await assertSafeFetchTarget(url);
const controller = new AbortController();
const timeout = setTimeout(() => controller.abort(), SUBSCRIPTION_FETCH_TIMEOUT_MS);
try {
const res = await fetch(url, { redirect: "manual", signal: controller.signal, headers });
if (res.status >= 300 && res.status < 400) {
const loc = res.headers.get("location");
if (!loc) throw new Error("Subscription fetch redirected without Location");
// Resolve relative redirects and re-validate the target (SSRF guard).
const next = new URL(loc, url).toString();
await assertSafeFetchTarget(next);
const res2 = await fetch(next, { redirect: "manual", signal: controller.signal, headers });
if (res2.status >= 300 && res2.status < 400) {
throw new Error("Subscription fetch: too many redirects");
}
if (!res2.ok) {
throw new Error(`Subscription fetch failed: HTTP ${res2.status}`);
}
return await res2.text();
}
if (!res.ok) {
throw new Error(`Subscription fetch failed: HTTP ${res.status}`);
}
return await res.text();
} finally {
clearTimeout(timeout);
}
}
/**
* Classify a fetch error as retryable. Transient (retry): network/timeout/DNS
* failures, HTTP 5xx, and HTTP 429. Permanent (no retry): 4xx client errors
* (except 429) and any SSRF-guard block — those will never succeed on retry.
*/
function isSubscriptionFetchRetryable(e: unknown): boolean {View on GitHub (pinned to a179ffed5b)
When it happens
Trigger: Thrown at src/lib/proxySubscription/subscriptionService.ts:344 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25).
Data as JSON: /api/errors/d8581a9117fc1df2.
Report an issue: GitHub.