diegosouzapw/OmniRoute · error · NotionTimeoutError
Notion API request timed out after 55s
Error message
Notion API request timed out after 55s
What it means
notionFetch(): the AbortController fired at the hard 55s deadline and the resulting AbortError is converted into a typed NotionTimeoutError, distinguishing transport timeouts from Notion rate-limit/server errors that are retried.
Solutions
- Retry the request — Notion rate-limits/queues often resolve
- Narrow the query (smaller page_size, filtered search) to shorten latency
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at src/lib/notion/api.ts:139 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/22d2a6aba9499ce5.
Report an issue: GitHub.
Appendix: source
Thrown at src/lib/notion/api.ts:139
const waitMs = error.retryAfter * 1000 + Math.pow(2, attempt) * 200;
await sleep(waitMs);
continue;
}
if (error instanceof NotionServerError && attempt < MAX_RETRIES - 1) {
lastError = error;
await sleep(Math.pow(2, attempt) * 500);
continue;
}
throw error;
}
return response.json();
} catch (err) {
if (err instanceof Error && err.name === "AbortError") {
clearTimeout(timeout);
throw new NotionTimeoutError("Notion API request timed out after 55s");
}
if (err instanceof NotionAuthError || err instanceof NotionNotFoundError || err instanceof NotionValidationError) {
clearTimeout(timeout);
throw err;
}
if (attempt < MAX_RETRIES - 1) {
lastError = err instanceof Error ? err : new NotionServerError(String(err));
await sleep(Math.pow(2, attempt) * 500);
continue;
}
}
}
clearTimeout(timeout);
throw lastError ?? new NotionServerError("Exhausted all retries");
}
function combineSignals(...signals: AbortSignal[]): AbortSignal {View on GitHub (pinned to a179ffed5b)