sources: catch generic errors from playwright
This commit is contained in:
parent
aa854141b9
commit
51253e4a37
|
@ -9,6 +9,7 @@ from aiohttp import ClientConnectionError, ClientSession
|
|||
from bs4 import BeautifulSoup
|
||||
from playwright.async_api import (
|
||||
BrowserContext,
|
||||
Error,
|
||||
Page,
|
||||
Route,
|
||||
TimeoutError,
|
||||
|
@ -38,8 +39,12 @@ class Browser:
|
|||
except TimeoutError:
|
||||
if retry == 3:
|
||||
self._source._error_summary.add_error(
|
||||
f"Error while loading {url} : timeout, retried 3 times"
|
||||
f"Timeout while loading {url} : retried 3 times, skipping"
|
||||
)
|
||||
except Error as ex:
|
||||
self._source._error_summary.add_error(
|
||||
f"Error while loading {url} : {ex}"
|
||||
)
|
||||
yield page
|
||||
await page.close()
|
||||
|
||||
|
|
Loading…
Reference in New Issue