diff options
| -rw-r--r-- | python/report_ops/cash.py | 6 | ||||
| -rw-r--r-- | python/report_ops/custodians.py | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/python/report_ops/cash.py b/python/report_ops/cash.py index 3bebbc5a..6e8aff87 100644 --- a/python/report_ops/cash.py +++ b/python/report_ops/cash.py @@ -8,7 +8,6 @@ from .custodians import NT, UMB, BNY, SCOTIA from functools import partial from dataclasses import dataclass -from selenium.common.exceptions import StaleElementReferenceException from serenitas.utils.env import DAILY_DIR @@ -144,10 +143,7 @@ class SeleneScotiaCashReport( self._staging_queue.clear() def get_cash_report(self, prefix=None): - try: - self.download_reports(self.date) - except StaleElementReferenceException: - raise ValueError(f"File is not ready to download yet") + self.download_reports(self.date) REPORT_DIR = DAILY_DIR / "Selene" / "Scotia_reports" try: return next( diff --git a/python/report_ops/custodians.py b/python/report_ops/custodians.py index babbf85d..288f81f6 100644 --- a/python/report_ops/custodians.py +++ b/python/report_ops/custodians.py @@ -2,6 +2,7 @@ import datetime from typing import ClassVar from dataclasses import dataclass import gpg +from selenium.common.exceptions import StaleElementReferenceException from serenitas.utils.exchange import ExchangeMessage, FileAttachment from serenitas.utils.env import DAILY_DIR @@ -206,4 +207,7 @@ class BNY(Custodian, account="BONY2"): class SCOTIA(Custodian, account="SCOTIA"): @staticmethod def download_reports(date=datetime.date.today()): - return download_scotia_report(date) + try: + return download_scotia_report(date) + except StaleElementReferenceException: + raise ValueError(f"Scotia report not ready yet for {date}") |
