diff --git a/ofx_processor/downloaders/lcl.py b/ofx_processor/downloaders/lcl.py index 28b8ba4..0222c40 100644 --- a/ofx_processor/downloaders/lcl.py +++ b/ofx_processor/downloaders/lcl.py @@ -1,3 +1,4 @@ +import os import time from pathlib import Path @@ -35,6 +36,14 @@ class LclDownloader: self.selenium.implicitly_wait(30) def download(self) -> str: + try: + return self._download() + except Exception: + screenshot = Path(os.getenv("SCREENSHOT_DIR", default="/tmp")) / "error_download.png" + self.selenium.save_screenshot(screenshot) + raise + + def _download(self) -> str: selenium = self.selenium click.secho("Logging in to LCL...", fg="blue") diff --git a/pyproject.toml b/pyproject.toml index bd4749a..e1ab074 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "ofx-processor" -version = "4.4.2" +version = "4.4.3" description = "Personal ofx processor" readme = "README.md" authors = ["Gabriel Augendre "]