diff --git a/openadapt/entrypoint.py b/openadapt/entrypoint.py index cfb9036a2..2a72a65fa 100644 --- a/openadapt/entrypoint.py +++ b/openadapt/entrypoint.py @@ -6,8 +6,9 @@ # This needs to be called before any code that uses multiprocessing multiprocessing.freeze_support() +from datetime import datetime -from openadapt.build_utils import redirect_stdout_stderr +from openadapt.build_utils import get_root_dir_path, redirect_stdout_stderr def run_openadapt() -> None: @@ -20,8 +21,10 @@ def run_openadapt() -> None: print_config() load_alembic_context() tray._run() - except Exception: - pass + except Exception as exc: + data_dir = get_root_dir_path() + with open(data_dir / "error.log", "a") as f: + f.write(f"{datetime.now()}: {exc}\n") if __name__ == "__main__":