fix: Defer page object cleanup to make it accessible in error handlers#1814
fix: Defer page object cleanup to make it accessible in error handlers#1814
Conversation
janbuchar
commented
Mar 27, 2026
- closes PlaywrightCrawler error_handler cannot access Page object #1482
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1814 +/- ##
==========================================
+ Coverage 92.25% 92.28% +0.02%
==========================================
Files 157 157
Lines 10847 10886 +39
==========================================
+ Hits 10007 10046 +39
Misses 840 840
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
vdusek
left a comment
There was a problem hiding this comment.
Just a few comments/questions, otherwise LGTM
Pijukatel
left a comment
There was a problem hiding this comment.
Nice. Please also remove a portion of the ErrorTracker-related code that becomes redundant with this change.
There was a problem hiding this comment.
As far as I understand this change. This should now be redundant,
So all this can be deleted and also the whole early argument and all its usage (_early_reported_errors) . ErrorTracker is private, so such a change is fine.
# Collect data in case of errors, before the page object is closed.
if error:
await self.statistics.error_tracker.add(error=error, context=context, early=True)
There was a problem hiding this comment.
Thanks, implemented!