Fix AttributeError in _wait_for_page_ready_before_action (#4563)

This commit is contained in:
pedrohsdb
2026-01-27 17:25:24 -08:00
committed by GitHub
parent 6ac311e033
commit 912d8dfa15
3 changed files with 45 additions and 5 deletions

View File

@@ -2456,8 +2456,23 @@ class ForgeAgent:
break
except (FailedToTakeScreenshot, ScrapingFailed) as e:
if idx < len(SCRAPE_TYPE_ORDER) - 1:
LOG.warning(
"Scrape attempt failed, will retry with next strategy",
attempt=idx + 1,
scrape_type=scrape_type.value if hasattr(scrape_type, "value") else str(scrape_type),
error_type=e.__class__.__name__,
url=task.url,
)
continue
LOG.exception(f"{e.__class__.__name__} happened in two normal attempts and reload-page retry")
LOG.error(
"All scrape attempts failed",
total_attempts=len(SCRAPE_TYPE_ORDER),
error_type=e.__class__.__name__,
url=task.url,
step_order=step.order,
step_retry=step.retry_index,
exc_info=True,
)
raise e
if scraped_page is None: