Skip to content

Commit 36352fb

Browse files
committed
Fix Node.js e2e: re-throw non-timeout goto errors, add 'navigating' to retry
Previously the catch block swallowed ALL page.goto errors, causing page.content() to fail with 'navigating' when the page hadn't finished. Now only timeout errors silently proceed; all other errors propagate to the retry loop which already handles network failures.
1 parent d65d140 commit 36352fb

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,10 @@ async function fetchHtml(url, template, blockMedia) {
328328
timeout: 15000,
329329
});
330330
} catch (_navError) {
331-
// Allow partial rendering on timeout
331+
// Allow partial rendering on timeout only
332+
if (!_navError.message?.includes("timeout") && !_navError.message?.includes("Timeout")) {
333+
throw _navError;
334+
}
332335
}
333336

334337
// Check HTTP status for access failures
@@ -377,7 +380,8 @@ async function fetchHtmlWithRetry(url, template, blockMedia) {
377380
attempt < FETCH_MAX_ATTEMPTS - 1 &&
378381
(err.message.includes("net::") ||
379382
err.message.includes("ERR_") ||
380-
err.message.includes("Navigation failed"))
383+
err.message.includes("Navigation failed") ||
384+
err.message.includes("navigating"))
381385
) {
382386
await sleep(500);
383387
continue;

0 commit comments

Comments
 (0)