diegosouzapw/OmniRoute · error · FetchTimeoutError
Request to timed out after ms
Error message
Request to ${url} timed out after ${timeoutMs}ms What it means
FetchTimeoutError thrown by the fetch-with-timeout helper when the AbortController fires before the response arrives: the request to `url` exceeded timeoutMs. The original AbortError is converted so callers get a typed, message-rich timeout instead of a generic abort.
Solutions
- Increase timeoutMs for slow upstreams (large models, cold starts)
- Check network path/proxy latency to the target host
- Verify the upstream is alive; timeouts often mask outages
- Catch FetchTimeoutError separately from other network errors to apply timeout-specific retry policy
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at src/shared/utils/fetchTimeout.ts:45 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
- Timeouts: ETIMEDOUT, deadlines, and hung requests — what actually expires when a request times out.
AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25).
Data as JSON: /api/errors/750a81e9318986d2.
Report an issue: GitHub.
Appendix: source
Thrown at src/shared/utils/fetchTimeout.ts:45
// If an external signal was provided, wire it to abort our controller too
if (externalSignal) {
if (externalSignal.aborted) {
controller.abort();
} else {
externalSignal.addEventListener("abort", () => controller.abort(), { once: true });
}
}
try {
const doFetch = fetchFn || globalThis.fetch;
const response = await doFetch(url, {
...fetchOptions,
signal: controller.signal,
});
return response;
} catch (error: any) {
if (error.name === "AbortError") {
throw new FetchTimeoutError(
`Request to ${url} timed out after ${timeoutMs}ms`,
timeoutMs,
String(url)
);
}
throw error;
} finally {
clearTimeout(timeoutId);
}
}
/**
* Error thrown on fetch timeout.
*/
export class FetchTimeoutError extends Error {
timeoutMs: number;
url: string;
View on GitHub (pinned to a179ffed5b)