Skip to content

Commit

Permalink
Merge pull request #64 from rjra2611/feature-remove-redundant-error-log
Browse files Browse the repository at this point in the history
Handle exception for file not found
  • Loading branch information
Martin-Molinero authored Feb 1, 2022
2 parents f22a08d + 286d4cb commit 33c4182
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lean/components/cloud/data_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from lean.components.api.api_client import APIClient
from lean.components.config.lean_config_manager import LeanConfigManager
from lean.components.util.logger import Logger
from lean.models.errors import RequestFailedError
from lean.models.errors import MoreInfoError, RequestFailedError


def _store_local_file(file_content: bytes, file_path: Path):
Expand Down Expand Up @@ -63,6 +63,11 @@ def update_database_files(self):
data_dir / "market-hours" / "market-hours-database.json")

self._lean_config_manager.set_properties({"file-database-last-update": now.strftime('%m/%d/%Y')})
except MoreInfoError as e:
if "not found" in str(e):
pass
else:
self._logger.error(str(e))
except Exception as e:
self._logger.error(str(e))

Expand Down

0 comments on commit 33c4182

Please sign in to comment.