diff --git a/dailyreleases/main.py b/dailyreleases/main.py index 0f384a0..97f0a46 100644 --- a/dailyreleases/main.py +++ b/dailyreleases/main.py @@ -30,16 +30,20 @@ def listen_inbox() -> None: def main() -> None: - print(f"Starting Daily Releases Bot v{__version__}") - mode = CONFIG["main"]["mode"] - logger.info("Mode is %s", mode) + try: + print(f"Starting Daily Releases Bot v{__version__}") + mode = CONFIG["main"]["mode"] + logger.info("Mode is %s", mode) - if mode == "test": - generate(post=False) - if mode == "immediately": - generate(post=True, pm_recipients=CONFIG["reddit"]["notify_users"].split(",")) - if mode == "reply": - listen_inbox() + if mode == "test": + generate(post=False) + if mode == "immediately": + generate(post=True, pm_recipients=CONFIG["reddit"]["notify_users"].split(",")) + if mode == "reply": + listen_inbox() + except Exception as e: + logger.exception(e) + raise e if __name__ == '__main__':