diff --git a/meteor/downloader.py b/meteor/downloader.py index f684412..a26e976 100644 --- a/meteor/downloader.py +++ b/meteor/downloader.py @@ -23,6 +23,7 @@ import tarfile import json from typing import ClassVar +import sys @dataclass @@ -47,8 +48,9 @@ def load_catalogues_config() -> dict: with importlib.resources.as_file(config_data) as configuration_path: with configuration_path.open("rt", encoding="UTF-8") as config: return json.load(config) - except AssertionError: + except FileNotFoundError: logging.error("The file %s is missing in meteor source", Downloader.CONFIG_DATA_FILE.name) + sys.exit(1) @staticmethod def get_available_catalogues() -> list[str]: diff --git a/meteor/meteor.py b/meteor/meteor.py index d42a2fb..9996bd6 100644 --- a/meteor/meteor.py +++ b/meteor/meteor.py @@ -667,10 +667,10 @@ def main() -> None: # pragma: no cover """ Main program function """ - # Get arguments - args = get_arguments() # Let us logging logger = get_logging() + # Get arguments + args = get_arguments() # version = importlib.metadata.version("meteor") # print("Meteor version", version) # Create a meteor dataset