From c13d163e1ed2e40e2c155206e74b8a9772430f70 Mon Sep 17 00:00:00 2001 From: obar1 <387386+obar1@users.noreply.github.com> Date: Sat, 7 Sep 2024 18:19:48 +0000 Subject: [PATCH] wip --- zero_to_one_hundred/configs/a_config_map.py | 2 +- zero_to_one_hundred/runner.py | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/zero_to_one_hundred/configs/a_config_map.py b/zero_to_one_hundred/configs/a_config_map.py index a805826..5479d83 100644 --- a/zero_to_one_hundred/configs/a_config_map.py +++ b/zero_to_one_hundred/configs/a_config_map.py @@ -20,7 +20,7 @@ class LegendIcons: def __init__(self, persist_fs: APersistFS): self.map_yaml_path = os.getenv(AConfigMap.MAP_YAML_PATH) if self.map_yaml_path is None: - raise SomeError(f"map_yaml_path {self.map_yaml_path} is not valid") + raise SomeError(f"map_yaml_path {self.map_yaml_path} is not valid, please set it in the env") self.persist_fs = persist_fs def __repr__(self): diff --git a/zero_to_one_hundred/runner.py b/zero_to_one_hundred/runner.py index 993f5fd..7c846fb 100644 --- a/zero_to_one_hundred/runner.py +++ b/zero_to_one_hundred/runner.py @@ -3,6 +3,7 @@ import traceback from typing import List +from zero_to_one_hundred.exceptions.errors import SomeError from zero_to_one_hundred.factories.a_factory import AFactory from zero_to_one_hundred.factories.a_factory_provider import AFactoryProvider @@ -19,7 +20,12 @@ def run_core(argv: List[str], factory_provider: AFactoryProvider): try: factory = factory_provider.provide() [processor.process() for processor in factory.get_processor(argv) if processor] - + except SomeError as se: + print(se) + return + except FileNotFoundError as se: + print(se) + return except Exception as e: print(e) traceback.print_exc()