fix: better handling if capture fails.

playwright
Raphaël Vinot 2022-04-21 15:48:28 +03:00
parent fa54cb2caa
commit 680eb1b309
1 changed files with 3 additions and 2 deletions

View File

@ -143,8 +143,9 @@ class AsyncCapture(AbstractManager):
await capture.prepare_context() await capture.prepare_context()
entries = await capture.capture_page(url, referer=referer) entries = await capture.capture_page(url, referer=referer)
except Exception as e: except Exception as e:
self.logger.critical(f'Something went terribly wrong when capturing {url}.') self.logger.critical(f'Something went terribly wrong when capturing {url} - {e}')
raise e return False, f'Something went terribly wrong when capturing {url}.'
if not entries: if not entries:
# broken # broken
self.logger.critical(f'Something went terribly wrong when capturing {url}.') self.logger.critical(f'Something went terribly wrong when capturing {url}.')